ghkweon / dwscript

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

workaround for QC110889 required on XE3 64bit #491

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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.

Original issue reported on code.google.com by bogdan...@gmail.com on 5 Oct 2014 at 9:32

GoogleCodeExporter commented 8 years ago
Correction: dwscript revision 2607.

Original comment by bogdan...@gmail.com on 6 Oct 2014 at 1:53