diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-12-26 17:47:26 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-12-26 17:47:26 +0900 |
| commit | 14bff248c37fd54d0b4afc0f58e12cbc67978f8e (patch) | |
| tree | 29ccee8d583330bed59be738ecf44190e989d1dd /src | |
| parent | efbaa53c532525818b2e167b55501e556c1eb2cd (diff) | |
| download | mruby-14bff248c37fd54d0b4afc0f58e12cbc67978f8e.tar.gz mruby-14bff248c37fd54d0b4afc0f58e12cbc67978f8e.zip | |
adjust register position for return value; fix #1620
Diffstat (limited to 'src')
| -rw-r--r-- | src/codegen.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/codegen.c b/src/codegen.c index fc83244f2..a25d4aaa9 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -674,9 +674,7 @@ scope_body(codegen_scope *s, node *tree, int val) genop(scope, MKOP_AB(OP_RETURN, 0, OP_R_NORMAL)); } else { - pop(); - genop_peep(scope, MKOP_AB(OP_RETURN, cursp(), OP_R_NORMAL), NOVAL); - push(); + genop_peep(scope, MKOP_AB(OP_RETURN, scope->sp-1, OP_R_NORMAL), NOVAL); } } scope_finish(scope); |
