Interpret for (;;) correctly
This commit is contained in:
parent
aad20e3ee5
commit
1a7b240cb0
@ -95,7 +95,8 @@ EvalResult eval(Node &ast, Memory &memory) {
|
|||||||
eval(node.children[0], memory);
|
eval(node.children[0], memory);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
int cond = bool_cast(eval(node.children[1], memory));
|
EvalResult e1 = eval(node.children[1], memory);
|
||||||
|
int cond = holds_alternative<monostate>(e1) || bool_cast(e1);
|
||||||
if (!cond) break;
|
if (!cond) break;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user