Hi!

I have a large project and it compiles under 32 bits cpu,
but doesn't under 64 bits. Here is a minimal problematic
part:

=====================================================
[doj@larion ~/temp]$ cat ptrtransform.pas
{$MODE OBJFPC}
const
  C = -1;
var
  A: array[0..1] of Pointer;
begin
  Writeln(Integer(Pointer((PtrUInt(@A[1]) + C * SizeOf(Pointer)))^));
end.

[doj@larion ~/temp]$ fpc ptrtransform.pas
ptrtransform.pas(7,66) Fatal: Internal error 200706094
Fatal: Compilation aborted
Error: /home/doj/fpc/2.7.1/bin/ppcx64 returned an error exitcode

[doj@larion ~/temp]$ fpc -iW
2.7.1

=====================================================

IMO the problem is the transformation -1 into an unsigned value.
(Unsigned(-1) > Max(Signed).)

How can I rewrite this code to make it correct? I want to use
constants to calculate offsets from untyped pointer.

--
Victor Matuzenko (Виктор Матузенко)

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to