Forum > General

Free Pascal IDE, Runtime error 4216927?!


See the 2 attached images and test code below.  Between the two images is a "Step Over" (F8 in the IDE).  Prod64 : QWord (64-bit unsigned) has value 3618239625 = $00000000d7a9f489.  I want to put the 32 LS bits into TempDivIntoIt : Longint (32-bit signed).  Executing the test code below produces the desired output "3618239625 -676727671", but the single-step in the IDE produces Run Time Error 4216927, Error Address $00000000, loss of Watch Window values, and what appears to be a messed up call stack.

How do I to interpret these results?

What should my path forward be?  (Bug report?  Workarounds?  Debugging suggestions? ...)

program bugtest;
   TempDivIntoIt :Longint;
   Prod64 :QWord;
   Prod64 := 3618239625;
   TempDivIntoIt := Longword(Prod64);
   writeln(Prod64, ' ', TempDivIntoIt);


--- Quote from: Rick314 on February 27, 2015, 03:27:45 am ---How do I to interpret these results?

--- End quote ---

I don't use this IDE, but based on the call stack in the second image, it is a range check error (fpc_rangeerror). The error message is vague. The error happened because of the typecast Longword(Prod64). A proposed solution is to bypass the check at this point:

--- Code: ---   {$Push}
   {$RangeChecks Off}
   TempDivIntoIt := Longword(Prod64);

--- End code ---

Thank you engkin.  Your suggestion allowed me to go forward and continue what I was doing.


[0] Message Index

Go to full version