From 36c70f9107074e884daa762151fbf95ce761ca36 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sun, 4 Dec 2022 16:23:33 -0600 Subject: [PATCH] Move ResolveForwardReference call to apply to the field being initialized. --- Parser.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Parser.pas b/Parser.pas index 32ba8a3..7d344c8 100644 --- a/Parser.pas +++ b/Parser.pas @@ -2608,8 +2608,6 @@ var maxDisp := disp; lSuppressMacroExpansions := suppressMacroExpansions; while true do begin - if (ip <> nil) and ip^.isForwardDeclared then - ResolveForwardReference(ip); if token.kind = rbracech then {fill remainder with zeros} goto 2; hasNestedDesignator := false; @@ -2669,6 +2667,8 @@ var if (ip = nil) or (ip^.itype^.size = 0) then goto 2; + if ip^.isForwardDeclared then + ResolveForwardReference(ip); disp := startingDisp + ip^.disp; if ip^.bitsize <> 0 then begin {zero out padding bits in bitfields} bfp := ip;