ghkweon / dwscript

Automatically exported from code.google.com/p/dwscript
0 stars 0 forks source link

Passing a JSONVariant sub-value to a const argument can raise an AV #460

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
procedure TestVal(const value: JSONVariant);
begin
end;

procedure Test;
var data: JSONVariant;
begin
   data := JSON.Parse('[ [], [] ]');
   for var i := 0 to data.length() - 1 do
      testVal(data[i]);

   print('Success!');
end;

Test;

This crashes in the EvalPushExprs part of the call to testVal, because the 
first argument is interpreted as potAddr rather than potResult, which leads to 
TConnectorCallExpr.GetDataPtr being called with a passed-in Result of nil, 
which gives an access violation.

Original issue reported on code.google.com by masonwhe...@gmail.com on 30 Mar 2014 at 1:48

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r2489.

Original comment by zar...@gmail.com on 3 Apr 2014 at 8:19