IR: add error for goto jumping over variable declaration

This commit is contained in:
Andrew Kelley committed 2016-12-31 01:58:37 -05:00
1 parent 76fa6cdce3
commit 2ccdaee101
2 files changed
+12 -3

No files matched your search

+2
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));