From 94c87243ca2a55d5374a22900b59bfbdda348d8a Mon Sep 17 00:00:00 2001 From: "J. Gareth \"Curious Kit\" Moreton" Date: Sat, 9 Jul 2022 17:44:20 +0100 Subject: [PATCH] * Reference counts are now properly incremented on duplicated taicpu objects --- compiler/aasmtai.pas | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compiler/aasmtai.pas b/compiler/aasmtai.pas index edd9c9158c..fdd83d269b 100644 --- a/compiler/aasmtai.pas +++ b/compiler/aasmtai.pas @@ -3143,6 +3143,14 @@ implementation begin new(p.oper[i]^.ref); p.oper[i]^.ref^:=oper[i]^.ref^; + if Assigned(p.oper[i]^.ref^.symbol) then + p.oper[i]^.ref^.symbol.increfs; + if Assigned(p.oper[i]^.ref^.relsymbol) then + p.oper[i]^.ref^.relsymbol.increfs; +{$ifdef jvm} + if Assigned(p.oper[i]^.ref^.indexsymbol) then + p.oper[i]^.ref^.indexsymbol.increfs; +{$endif jvm} end; {$ifdef ARM} top_shifterop: