Interpret for (;;) correctly

This commit is contained in:
ala89 2023-12-13 16:01:54 +01:00
parent aad20e3ee5
commit 1a7b240cb0

View File

@ -95,7 +95,8 @@ EvalResult eval(Node &ast, Memory &memory) {
eval(node.children[0], memory);
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;
try {