From 9030052616d1ba891b101fbd17caf251481907b0 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Tue, 24 Dec 2019 18:23:41 -0600 Subject: [PATCH] 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. --- Parser.pas | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Parser.pas b/Parser.pas index 0493823..566d601 100644 --- a/Parser.pas +++ b/Parser.pas @@ -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