Przeglądaj źródła

* arm: Symbol reference counts are corrected when PC-relative data is inserted

J. Gareth "Curious Kit" Moreton 3 lat temu
rodzic
commit
be39828fca
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4 1
      compiler/arm/aasmcpu.pas

+ 4 - 1
compiler/arm/aasmcpu.pas

@@ -1173,10 +1173,13 @@ implementation
                                                 begin
                                                   with taicpu(curtai).oper[curop]^.ref^ do
                                                     begin
+                                                      symbol.decrefs;
                                                       symboldata:=hp2.previous;
                                                       symbol:=tai_label(hp2.previous).labsym;
+                                                      symbol.increfs;
                                                     end;
-                                                  removeref:=true;
+                                                  if not tai_label(curdatatai).labsym.is_used then
+                                                    removeref:=true;
                                                   break;
                                                 end;
                                               hp2:=tai(hp2.next);