summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-12-19 06:05:49 -0800
committerYukihiro "Matz" Matsumoto <[email protected]>2013-12-19 06:05:49 -0800
commit7dffeb6215f6274c7c60cb5fde06a3e02405532a (patch)
treef186e7f44fe7eb7ec58853759e39ba9455ced8e7
parentd7a34b625bbcb954b38e24e78958b93a2cc1e249 (diff)
parent61ac9ff2eaa9da7d505b17e4ca8a5cbb90d16ea0 (diff)
downloadmruby-7dffeb6215f6274c7c60cb5fde06a3e02405532a.tar.gz
mruby-7dffeb6215f6274c7c60cb5fde06a3e02405532a.zip
Merge pull request #1612 from h2so5/node-case
fix codegen bug in NODE_CASE
-rw-r--r--src/codegen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/codegen.c b/src/codegen.c
index ef3a716f9..dc80f2592 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -1409,10 +1409,13 @@ codegen(codegen_scope *s, node *tree, int val)
tree = tree->cdr;
}
if (val) {
+ int pos = cursp();
genop(s, MKOP_A(OP_LOADNIL, cursp()));
+ if (pos3) dispatch_linked(s, pos3);
+ pop();
+ genop(s, MKOP_AB(OP_MOVE, cursp(), pos));
push();
}
- if (pos3) dispatch_linked(s, pos3);
}
break;