When initializing bitfields of type long, do not treat their values as pointer constants.

This was inappropriate and would lead to memory trashing.

Fixes case 3 in issue #59.
This commit is contained in:
Stephen Heumann 2019-12-24 18:23:41 -06:00
parent ae6de310c7
commit 9030052616
1 changed files with 3 additions and 2 deletions

View File

@ -2015,8 +2015,9 @@ var
2: DisposeTree(initializerTree);
end {if}
else begin
if (tp^.kind = pointerType)
or ((tp^.kind = scalarType) and (tp^.baseType in [cgLong,cgULong]))
if ((tp^.kind = pointerType)
or ((tp^.kind = scalarType) and (tp^.baseType in [cgLong,cgULong])))
and (bitsize = 0)
then begin
iPtr^.iType := ccPointer;
if variable^.storage in [external,global,private] then begin