[fpc-pascal] Internal error 200706094
Victor Matuzenko
vitek03 at gmail.com
Mon Sep 29 11:48:30 CEST 2014
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 at 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 at 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 at 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 (Виктор Матузенко)
More information about the fpc-pascal
mailing list