Compilation with "+ +" raise AV error

Issue #239 resolved
Alex Bespalov created an issue

if try to compile script like

program Test_closure;
var  i: Integer;

begin
i := 5;
PrintLn('Test' + IntToStr(i) + +)
end.

Access violation error raised.

Usually thats raised when autocompilation enabled (like in “Live scripting IDE” demo),.

As my opinion, the solution should be to change line in dwsCompiler.pas

if ResolveOperatorFor(CurrentProg, ttMINUS, nil, Result.Typ) = nil then

to

if not Assigned(Result) or (ResolveOperatorFor(CurrentProg, ttMINUS, nil, Result.Typ) = nil) then

Comments (2)

  1. Log in to comment