summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-04-11 02:30:24 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-04-11 02:30:24 +0900
commitfff4a4ed34b2692227b0f9d5773872b8410fd08d (patch)
treea6b4f94e6f229d9f34b7fd090b3b1d3ba5fc2dc5
parentdb47ae5de559f95dd4e9821a01e393dee38d9404 (diff)
downloadmruby-fff4a4ed34b2692227b0f9d5773872b8410fd08d.tar.gz
mruby-fff4a4ed34b2692227b0f9d5773872b8410fd08d.zip
OP_LAMBDA generation should honor VAL/NOVAL; fix #3580
-rw-r--r--mrbgems/mruby-compiler/core/codegen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c
index 64f4702a7..901e87934 100644
--- a/mrbgems/mruby-compiler/core/codegen.c
+++ b/mrbgems/mruby-compiler/core/codegen.c
@@ -1383,7 +1383,7 @@ codegen(codegen_scope *s, node *tree, int val)
break;
case NODE_LAMBDA:
- {
+ if (val) {
int idx = lambda_body(s, tree, 1);
genop(s, MKOP_Abc(OP_LAMBDA, cursp(), idx, OP_L_LAMBDA));
@@ -1392,7 +1392,7 @@ codegen(codegen_scope *s, node *tree, int val)
break;
case NODE_BLOCK:
- {
+ if (val) {
int idx = lambda_body(s, tree, 1);
genop(s, MKOP_Abc(OP_LAMBDA, cursp(), idx, OP_L_BLOCK));