OP_RETURN operand should be stack position of the new scope, not the current scope

This commit is contained in:
Yukihiro Matsumoto
2012-06-01 23:56:17 +09:00
parent d6337e48ad
commit a0b30fc01f
+1 -1
View File
@@ -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);