View Issue Details

IDProjectCategoryView StatusLast Update
0035348FPCCompilerpublic2019-04-14 20:49
ReporterThaddy de Koning Assigned ToSven Barth  
Status resolvedResolutionfixed 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0035348: operators inc/dec crashes the compiler when a default value is given for the amount.
DescriptionThe operators inc/dec generate a compiler crash when the amount parameter has a default value.
Steps To Reproduce// example taken from engkin's entry on the forum
{$mode objfpc}{$H+}
operator inc(az: TAZ; i: integer=1) raz:TAZ; // inline;
Additional InformationSame example also crashes with dec.
It does not crash when no default value is given.
It maybe simply that the default value should not be allowed, but the compiler should not crash.

I wonder if these operators should not be dropped: the procedure overloads are fine.
TagsNo tags attached.
Fixed in Revision41869
Attached Files


Thaddy de Koning

2019-04-09 08:12

reporter   ~0115338

See forum here,44982.msg316824.html#msg316824

Sven Barth

2019-04-14 20:49

manager   ~0115507

This now fails correctly no matter if there is a default value or not as Inc/Dec are unary operators.

Issue History

Date Modified Username Field Change
2019-04-09 08:07 Thaddy de Koning New Issue
2019-04-09 08:12 Thaddy de Koning Note Added: 0115338
2019-04-14 20:49 Sven Barth Fixed in Revision => 41869
2019-04-14 20:49 Sven Barth Note Added: 0115507
2019-04-14 20:49 Sven Barth Status new => resolved
2019-04-14 20:49 Sven Barth Fixed in Version => 3.3.1
2019-04-14 20:49 Sven Barth Resolution open => fixed
2019-04-14 20:49 Sven Barth Assigned To => Sven Barth