Skip to content

overflow is falsely thrown

Original Reporter info from Mantis: helbig
  • Reporter name: Wolfgang Helbig

Description:

The following program will abort with an overflow error for no apperant reason.
{$MODE ISO}
{$Q+}
program nabs(input, output);
  type halfword = 0..65535;
  var a, b: halfword;
begin
  a := 4095;
  b := 4096;
  if abs(int(a+b-8192)) < 4096 then writeln('ok');
end.

Steps to reproduce:

$ fpc nabs.p
$ nabs
Runtime error 215 at $000000010DE69401
$000000010DE69401

Mantis conversion info:

  • Mantis ID: 37875
  • OS: os x
  • OS Build: 10.11
  • Platform: imac
  • Version: 3.2.0
  • Monitored by: » helbig (Wolfgang Helbig)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information