View Issue Details

IDProjectCategoryView StatusLast Update
0036356FPCCompilerpublic2019-11-25 12:37
Reporteravk Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platformx86-64OSLinux 
Product Version3.3.1 
Summary0036356: Overflow error
DescriptionCompile time overflow error when OverflowCheck disabled.
Attached is a simple example that reproduces the problem.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

avk

2019-11-25 11:27

reporter  

overflow.pas (267 bytes)   
program overflow;
{$mode objfpc}{$Q-}{$R-}{$MACRO ON}

{$DEFINE c1 := QWord($9e3779b185ebca87)}
{$DEFINE c2 := QWord($c2b2ae3d27d4eb4f)}

function DoIt(aValue: QWord): QWord;
begin
  Result := aValue + c1 + c2;
end;

begin
  WriteLn(DoIt(100001));
end.
overflow.pas (267 bytes)   

Thaddy de Koning

2019-11-25 12:36

reporter   ~0119488

Last edited: 2019-11-25 12:37

View 2 revisions

marcov has made a good point why in {$Q-} state this should never happen.
See: https://forum.lazarus.freepascal.org/index.php/topic,47530.msg340477.html#msg340477

In that sense it is a regression.

Issue History

Date Modified Username Field Change
2019-11-25 11:27 avk New Issue
2019-11-25 11:27 avk File Added: overflow.pas
2019-11-25 12:36 Thaddy de Koning Note Added: 0119488
2019-11-25 12:37 Thaddy de Koning Note Edited: 0119488 View Revisions