IR: add error for goto jumping over variable declaration

This commit is contained in:
Andrew Kelley
2016-12-31 01:58:37 -05:00
parent 76fa6cdce3
commit 2ccdaee101
2 changed files with 12 additions and 3 deletions

View File

@@ -3008,6 +3008,8 @@ static void do_code_gen(CodeGen *g) {
}
if (ir_get_var_is_comptime(var))
continue;
if (type_requires_comptime(var->value.type))
continue;
if (var->src_arg_index == SIZE_MAX) {
var->value_ref = LLVMBuildAlloca(g->builder, var->value.type->type_ref, buf_ptr(&var->name));