Allow pointer arithmetic using long long values.

This converts them to 32-bit values before doing computations, which is (more than) sufficient for address calculations on the 65816. Trying to compute an address outside the legal range is undefined behavior, and does not necessarily "wrap around" in a predictable way.
This commit is contained in:
Stephen Heumann 2021-02-04 22:05:02 -06:00
parent 8992ddc11f
commit 7f3ba768cd

View File

@ -2122,10 +2122,12 @@ case tp of
Gen0(op);
end;
end;
cgLong,cgULong: begin
cgLong,cgULong,cgQuad,cgUQuad: begin
if tp in [cgQuad,cgUQuad] then
Gen2(pc_cnv, ord(tp), ord(cgLong));
if size <> 1 then begin
GenLdcLong(size);
if tp = cgLong then
if tp in [cgLong,cgQuad] then
Gen0(pc_mpl)
else
Gen0(pc_uml);