Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2014-09

Internal error 200706094

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Victor Matuzenko

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:

=====================================================
 ~/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.

~/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

~/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 (Виктор Матузенко)

Reply by email

waldo kitty
to Victor Matuzenko
Victor Matuzenko wrote 5 lines
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.

have you tried using a typed const?

const
   C : int64 = -1;
NOTE: No off-list assistance is given without prior approval. Please *keep mailing list traffic on the list* unless private contact is specifically requested and granted.

Reply by email

leledumbo
to Victor Matuzenko: Hi! I have a large project and it compiles under 32 bits cpu, but doesn't under 64 bits.…
How can I rewrite this code to make it correct? I want to use

constants to calculate offsets from untyped pointer.

You don't have to:
http://wiki.freepascal.org/Lazarus_Faq#.27Fatal:_Internal_error_XXXXYYZZW.27 so just report and wait for a fix, or fix it yourself if you can then post a patch (unless it's already fixed). You are using development version so a feature break is normal.

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Internal-error-200706094-tp5720190p5720201.html Sent from the Free Pascal - General mailing list .

Reply by email