mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #693 from masamitsu-murase/modify_unless
Modify NODE_IF handling.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user