From c371efb8826cb270aebd1c3cb4a74b75055ea53d Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Sat, 1 Dec 2012 23:23:00 +0100 Subject: [PATCH] Fix a type size bug: non-var locals overlapped with var locals, that was bad --- ir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ir.c b/ir.c index f1ffc7f..dbb1d97 100644 --- a/ir.c +++ b/ir.c @@ -2849,7 +2849,10 @@ static bool gen_global_function(ir_builder *ir, ir_value *global) if (vec_size(irfun->locals)) { ir_value *last = vec_last(irfun->locals); local_var_end = last->code.globaladdr; - local_var_end += type_sizeof[last->vtype]; + if (last->vtype == TYPE_FIELD && last->fieldtype == TYPE_VECTOR) + local_var_end += type_sizeof[TYPE_VECTOR]; + else + local_var_end += type_sizeof[last->vtype]; } for (i = 0; i < vec_size(irfun->values); ++i) { -- 2.39.2