unless without else should return nil if the condition is true.

This commit is contained in:
Masamitsu MURASE
2013-01-06 06:23:10 +09:00
parent 749404051c
commit d48bb813d8
+5 -1
View File
@@ -1099,8 +1099,12 @@ 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 && tree->cdr->car) pop();
if (val) pop();
pos2 = new_label(s);
genop(s, MKOP_sBx(OP_JMP, 0));
dispatch(s, pos1);