From a0b30fc01f828be699af21dae490219c7f864c70 Mon Sep 17 00:00:00 2001 From: Yukihiro Matsumoto Date: Fri, 1 Jun 2012 23:56:17 +0900 Subject: OP_RETURN operand should be stack position of the new scope, not the current scope --- src/codegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/codegen.c') diff --git a/src/codegen.c b/src/codegen.c index 1f4fa818c..505f0ad5b 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -532,7 +532,7 @@ scope_body(codegen_scope *s, node *tree) } else { codegen(scope, tree->cdr, VAL); - genop(scope, MKOP_AB(OP_RETURN, cursp(), OP_R_NORMAL)); + genop(scope, MKOP_AB(OP_RETURN, scope->sp, OP_R_NORMAL)); } scope_finish(scope, idx); -- cgit v1.2.3