summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-01-06 05:10:03 -0800
committerYukihiro "Matz" Matsumoto <[email protected]>2013-01-06 05:10:03 -0800
commitba9ca03e33e6b43c53da784bcc4f31b4f6ea327b (patch)
tree9169f6b686520a23df16edac5a858e571be3308d /src
parent54703d8494eb053e5ecb56705d15ba3d076c4633 (diff)
parentd48bb813d8a4a7b1f1ea87f9187f231ff22af24a (diff)
downloadmruby-ba9ca03e33e6b43c53da784bcc4f31b4f6ea327b.tar.gz
mruby-ba9ca03e33e6b43c53da784bcc4f31b4f6ea327b.zip
Merge pull request #693 from masamitsu-murase/modify_unless
Modify NODE_IF handling.
Diffstat (limited to 'src')
-rw-r--r--src/codegen.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/codegen.c b/src/codegen.c
index ffa13d647..c1a62320d 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -1099,6 +1099,10 @@ codegen(codegen_scope *s, node *tree, int val)
genop(s, MKOP_AsBx(OP_JMPNOT, cursp(), 0));
codegen(s, tree->cdr->car, val);
+ if (val && !(tree->cdr->car)) {
+ genop(s, MKOP_A(OP_LOADNIL, cursp()));
+ push();
+ }
if (e) {
if (val) pop();
pos2 = new_label(s);