From 7e8ea5bcf9e5df54a0a2b0a11b2e624b21156c31 Mon Sep 17 00:00:00 2001 From: Paul Fultz II Date: Fri, 1 Dec 2023 04:34:36 -0600 Subject: [PATCH] Avoid evaluating conditions twice when there isnt a value to evaluate (#5711) --- lib/programmemory.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/programmemory.cpp b/lib/programmemory.cpp index fccfe4099..aaef10b6a 100644 --- a/lib/programmemory.cpp +++ b/lib/programmemory.cpp @@ -208,6 +208,8 @@ static bool evaluateCondition(const std::string& op, evaluateCondition(op, r, condition->astOperand2(), pm, settings)) { return true; } + if (!pm.hasValue(condition->exprId())) + return false; } MathLib::bigint result = 0; bool error = false;