mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
codegen.c: need to push the value when the loop was eliminated.
This commit is contained in:
@@ -2165,14 +2165,20 @@ codegen(codegen_scope *s, node *tree, int val)
|
||||
case NODE_INT:
|
||||
case NODE_STR:
|
||||
if (nt == NODE_UNTIL) {
|
||||
if (val) genop_1(s, OP_LOADNIL, cursp());
|
||||
if (val) {
|
||||
genop_1(s, OP_LOADNIL, cursp());
|
||||
push();
|
||||
}
|
||||
goto exit;
|
||||
}
|
||||
break;
|
||||
case NODE_FALSE:
|
||||
case NODE_NIL:
|
||||
if (nt == NODE_WHILE) {
|
||||
if (val) genop_1(s, OP_LOADNIL, cursp());
|
||||
if (val) {
|
||||
genop_1(s, OP_LOADNIL, cursp());
|
||||
push();
|
||||
}
|
||||
goto exit;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user