From f5b98e38f894a5b2a5428fcb17bcae19c341fb3c Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Mon, 4 Nov 2013 15:32:26 -0500 Subject: [PATCH] [bugfix] allocate pic_env values area for local variables --- src/codegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegen.c b/src/codegen.c index 1556b817..678b9dbf 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -67,7 +67,7 @@ new_local_scope(pic_state *pic, pic_value args, codegen_scope *scope) } new_scope->argc = i; new_scope->localc = l; - new_scope->cv_tbl = (int *)pic_calloc(pic, i, sizeof(int)); + new_scope->cv_tbl = (int *)pic_calloc(pic, i + l, sizeof(int)); return new_scope; }