View Issue Details

IDProjectCategoryView StatusLast Update
0034971FPCCompilerpublic2019-02-01 18:32
ReporterKai BurghardtAssigned ToJonas Maebe 
Status resolvedResolutionfixed 
Platformx86_64OSGNU/LinuxOS Version4.2.0
Product Version3.0.4Product Build3.0.4+dfsg-11 [2017/12/30] 
Target VersionFixed in Version3.3.1 
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);
    structure: bitpacked record
        field: -1..1;
    i: longint;
    with structure do
        for i := low(field) to high(field) do
            field := i;
            writeLn(binStr(field, bitSizeOf(field)), ' ', field:4);
Fixed in Revision41161
Attached Files


Thaddy de Koning

2019-02-01 16: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 06:12 Kai Burghardt New Issue
2019-01-30 06:13 Kai Burghardt Tag Attached: packrecords
2019-02-01 16:02 Thaddy de Koning Note Added: 0113782
2019-02-01 18:32 Jonas Maebe Fixed in Revision => 41161
2019-02-01 18:32 Jonas Maebe Status new => resolved
2019-02-01 18:32 Jonas Maebe Fixed in Version => 3.3.1
2019-02-01 18:32 Jonas Maebe Resolution open => fixed
2019-02-01 18:32 Jonas Maebe Assigned To => Jonas Maebe