Export to GitHub

dwscript - issue #491

workaround for QC110889 required on XE3 64bit


Posted on Oct 5, 2014 by Quick Horse

What steps will reproduce the problem? 1. Compile the project DwsIdeDemo.dpr with Delphi XE3 64bit. 2. Run the program. 3. Execute any script (even a blank script causes the error).

What is the expected output? The script should execute.

What do you see instead? Project DwsIdeDemo.exe raised exception class $C0000005 with message 'c0000005 ACCESS_VIOLATION'.

What version of the product are you using? On what operating system? dwscript trunk revision 36618 Windows 7 Ultimate

Please provide any additional information below. I traced this to function StrDeleteLeft in dwsUtils always returning empty string on Delphi XE3 64bit due to QC110889 which has since been fixed in XE4.

See http://qc.embarcadero.com/wc/qcmain.aspx?d=110889 for more info.

For users still on Delphi XE3, it would be useful if you could implement the following workaround: always specify all three parameters when calling Copy. In function StrDeleteLeft, replace

Result:=Copy(aStr, n+1);

with

Result:=Copy(aStr, n+1, Length(aStr)-n);

In function StrAfterChar, replace

  Result:=Copy(aStr, p+1)

with

  Result:=Copy(aStr, p+1, Length(aStr)-p)

Also affected: TStrSplitFunc.DoEvalAsVariant in dwsStringFunctions.

Comment #1

Posted on Oct 6, 2014 by Quick Horse

Correction: dwscript revision 2607.

Status: New

Labels:
Type-Defect Priority-Medium