From 14ad038051f8cea90ae59416aa7e013353541ba7 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 17 Nov 2013 13:10:36 +0900 Subject: [PATCH] wipe reallocated cv_tbl --- src/codegen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/codegen.c b/src/codegen.c index 58302aaf..92721b72 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -172,7 +172,8 @@ scope_local_define(pic_state *pic, const char *name, codegen_scope *scope) struct xh_entry *e; e = xh_put(scope->local_tbl, name, scope->argc + scope->localc++); - scope->dirty_flags = (int *)pic_realloc(pic, scope->dirty_flags, (e->val + 1) * sizeof(int)); + scope->dirty_flags = (int *)pic_realloc(pic, scope->dirty_flags, (scope->argc + scope->localc) * sizeof(int)); + scope->dirty_flags[e->val] = 0; return e->val; }