summaryrefslogtreecommitdiffhomepage
path: root/src/codegen.c
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-06-01 23:56:17 +0900
committerYukihiro Matsumoto <[email protected]>2012-06-01 23:56:17 +0900
commita0b30fc01f828be699af21dae490219c7f864c70 (patch)
treecc5f152024f653ce7515f4a4cee0bb00ff6bf97d /src/codegen.c
parentd6337e48ad17648b50fc965ba27c99ceea2f258f (diff)
downloadmruby-a0b30fc01f828be699af21dae490219c7f864c70.tar.gz
mruby-a0b30fc01f828be699af21dae490219c7f864c70.zip
OP_RETURN operand should be stack position of the new scope, not the current scope
Diffstat (limited to 'src/codegen.c')
-rw-r--r--src/codegen.c2
1 files changed, 1 insertions, 1 deletions
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);