From 8fea13cc174da9d8ec5735e81723d17317e2248e Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Mon, 6 Oct 2025 18:20:39 +1100 Subject: [PATCH] Slight fix for var access --- src/executor/executor.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/executor/executor.cpp b/src/executor/executor.cpp index 9c4f1ec..0242eae 100644 --- a/src/executor/executor.cpp +++ b/src/executor/executor.cpp @@ -44,6 +44,12 @@ Value execute(Instruction inst) { if (inst.instruction == InstructionType::Assert) { return modules::assert(inst.args); } + + // For all other instructions, evaluate the arguments first + for(auto& arg : inst.args) { + arg = evaluate(arg); + } + if (inst.instruction == InstructionType::Variable) { auto& args = inst.args; @@ -235,11 +241,6 @@ Value execute(Instruction inst) { return Value(); } - // For all other instructions, evaluate the arguments first - for(auto& arg : inst.args) { - arg = evaluate(arg); - } - // Then, execute the instruction with the evaluated arguments switch (inst.instruction) { case InstructionType::Print: