Using FPC 3.2.2 on x86_64 Linux, I have this:
in acceptable) do begin
scratch *= radix;
if s[1] <= '9' then
scratch := scratch + (Ord(s[1]) - Ord('0')) // <------------------
else
scratch := scratch + (Ord(LowerCase(s[1])) - Ord('a') + 10);
Delete(s, 1, 1);
q += 1 (* Count of digits parsed *)
end;
That is, obviously, from a number parser which I'm extending from 32-bits to 64 (and hopefully later more).
At the indicated line the string variable s contains the single character '5', and scratch contains $9E3779B97F4A7C10.
That's16 hex digits, and the final one is zero.
Even with all runtime checks disabled, it results in "Range check error".
Why?
MarkMLl