View Issue Details

IDProjectCategoryView StatusLast Update
0034971FPCCompilerpublic2021-04-11 11:56
ReporterKai Burghardt Assigned ToJonas Maebe  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSGNU/Linux 
Product Version3.0.4 
Fixed in Version3.2.0 
Summary0034971: bitpacked keyword calculates wrong bitSizeOf for border case number ranges
DescriptionThe bitpacked keyword performs wrong bitSizeOf calculations for components that are ordinal types fulfilling certain border cases.
Steps To ReproduceThis program prints -1, 0, -1, but -1, 0, 1 is expected:

program bitpackingRanges(input, output, stderr);
var
    structure: bitpacked record
        field: -1..1;
    end;
    i: longint;
begin
    with structure do
    begin
        for i := low(field) to high(field) do
        begin
            field := i;
            writeLn(binStr(field, bitSizeOf(field)), ' ', field:4);
        end;
    end;
end.
Tagspackrecords
Fixed in Revision41161,41249
FPCOldBugId
FPCTarget-
Attached Files

Activities

Thaddy de Koning

2019-02-01 15:02

reporter   ~0113782

Confirmed also on armhf.
Even if you use for-in-do syntax.

Issue History

Date Modified Username Field Change
2019-01-30 05:12 Kai Burghardt New Issue
2019-01-30 05:13 Kai Burghardt Tag Attached: packrecords
2019-02-01 15:02 Thaddy de Koning Note Added: 0113782
2019-02-01 17:32 Jonas Maebe Fixed in Revision => 41161
2019-02-01 17:32 Jonas Maebe Status new => resolved
2019-02-01 17:32 Jonas Maebe Fixed in Version => 3.3.1
2019-02-01 17:32 Jonas Maebe Resolution open => fixed
2019-02-01 17:32 Jonas Maebe Assigned To => Jonas Maebe
2021-04-11 11:55 Jonas Maebe Fixed in Version 3.3.1 => 3.2.1
2021-04-11 11:55 Jonas Maebe Fixed in Revision 41161 => 41161,41249
2021-04-11 11:55 Jonas Maebe FPCTarget => -
2021-04-11 11:56 Jonas Maebe Fixed in Version 3.2.1 => 3.2.0