From 43b34a5533bd9f0c30c730e55790035a695a9969 Mon Sep 17 00:00:00 2001 From: "Christopher J. Hazard, PhD" <143410553+howsohazard@users.noreply.github.com> Date: Mon, 22 Jul 2024 12:45:31 -0400 Subject: [PATCH] 20995: Fixes crash with rand --- src/Amalgam/interpreter/InterpreterOpcodesBase.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Amalgam/interpreter/InterpreterOpcodesBase.cpp b/src/Amalgam/interpreter/InterpreterOpcodesBase.cpp index 05cdde16..a3ec09a3 100644 --- a/src/Amalgam/interpreter/InterpreterOpcodesBase.cpp +++ b/src/Amalgam/interpreter/InterpreterOpcodesBase.cpp @@ -1445,6 +1445,8 @@ EvaluableNodeReference Interpreter::InterpretNode_ENT_RAND(EvaluableNode *en, bo return EvaluableNodeReference::Null(); number_to_generate = static_cast(num_value); generate_list = true; + //because generating a list, can no longer return an immediate + immediate_result = false; } //make sure not eating up too much memory if(ConstrainedAllocatedNodes()) @@ -1748,6 +1750,8 @@ EvaluableNodeReference Interpreter::InterpretNode_ENT_WEIGHTED_RAND(EvaluableNod return EvaluableNodeReference::Null(); number_to_generate = static_cast(num_value); generate_list = true; + //because generating a list, can no longer return an immediate + immediate_result = false; } //make sure not eating up too much memory if(ConstrainedAllocatedNodes())