Crash accessing Dynamic Array within procedure

Issue #4 resolved
Steffen Binas created an issue

The following script code crashes with the current version (ee2dc49). I attached a testcase for inclusion in \Test\SimpleScripts\

var Stack: array of Integer = [];

procedure SimpleProc;
begin
  Print(Stack.Peek);
end;

Stack.Add(42);

// Works
Print(Stack.Peek); // Calls TObjectVarExpr.EvalAsScriptObject with the array

// Crashes
SimpleProc; // Calls TProgramExpr.EvalAsScriptObject with the array which is obviously wrong

Comments (2)

  1. Log in to comment