Skip to content

Commit

Permalink
21018: Fixes issue where while opcode could be stuck in an infinite l…
Browse files Browse the repository at this point in the history
…oop with performance constraints (#192)
  • Loading branch information
howsohazard authored Jul 23, 2024
1 parent 3b75776 commit 82702eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Amalgam/interpreter/InterpreterOpcodesBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,9 @@ EvaluableNodeReference Interpreter::InterpretNode_ENT_WHILE(EvaluableNode *en, b
if(!condition_true)
break;

if(AreExecutionResourcesExhausted())
//count an extra cycle for each loop
//this ensures that even if all of the nodes are immediate, it'll still count the performance
if(AreExecutionResourcesExhausted(true))
return EvaluableNodeReference::Null();

SetTopPreviousResultInConstructionStack(previous_result);
Expand Down

0 comments on commit 82702eb

Please sign in to comment.