Thanks to Stefan Glienke for pointing me at the below patch for [WayBack] Why doesn’t raise overflow exception on multiplication example or how to detect in this case?{$RANGECHECKS ON} {$OVERFLOWCHECKS ON}varvalue: Int64;… – Rafael Dipold – Google+.
It’s basically an issue in __llmulo
that has been documented but not solved since “forever”:
some people “some while ago” reported this and even posted a solution: [WayBack] http://qc.embarcadero.com/wc/qcmain.aspx?d=34049
And there it is again: [WayBack] http://qc.embarcadero.com/wc/qcmain.aspx?d=119146
And most recently: https://quality.embarcadero.com/browse/RSP-16617
FWIW here is a runtime patch that corrects this (using the version posted in QC#119146): https://pastebin.com/jzLgYeqm
The bug tracking of the Delphi team is so bad, that some of the reports actually mark this issue “As Designed” like in [WayBack] http://qc.embarcadero.com/wc/qcmain.aspx?d=118287
The below patch requires rights to call [WayBack] WriteProcessMemory as documented in [WayBack] How to Read and Write Other Process Memory.
–jeroen
Patch at [WayBack] https://pastebin.com/jzLgYeqm