ir: fix bug that functions without declared locals would put temps at position zero ...

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-19 16:49:24 +02:00
parent ae69812d92
commit 4d335c8704

2
ir.c
View file

@ -2548,7 +2548,7 @@ static bool gen_global_function(ir_builder *ir, ir_value *global)
fun.firstlocal = code_globals_elements;
fun.locals = irfun->allocated_locals + irfun->locals_count;
local_var_end = 0;
local_var_end = fun.firstlocal;
for (i = 0; i < irfun->locals_count; ++i) {
if (!ir_builder_gen_global(ir, irfun->locals[i])) {
irerror(irfun->locals[i]->context, "Failed to generate global %s\n", irfun->locals[i]->name);