2
0
Эх сурвалжийг харах

Fix invalid typecast by postponing sym change to after address resolution in 44094dba

Pierre Muller 3 жил өмнө
parent
commit
2c80b2419e

+ 1 - 1
compiler/rautils.pas

@@ -861,7 +861,6 @@ Begin
               begin
               begin
                 setvarsize(tabstractvarsym(sym));
                 setvarsize(tabstractvarsym(sym));
                 size_set_from_absolute:=true;
                 size_set_from_absolute:=true;
-                sym:=plist^.sym;
                 { Check if address can be resolved, but only if not an array }
                 { Check if address can be resolved, but only if not an array }
                 if (tabsolutevarsym(sym).abstyp=toaddr) and not
                 if (tabsolutevarsym(sym).abstyp=toaddr) and not
                   (assigned(plist^.next) and (plist^.next^.sltype=sl_vec)) then
                   (assigned(plist^.next) and (plist^.next^.sltype=sl_vec)) then
@@ -873,6 +872,7 @@ Begin
                     exit;
                     exit;
                   end;
                   end;
                 { resolve the chain of array indexes (if there are any) }
                 { resolve the chain of array indexes (if there are any) }
+                sym:=plist^.sym;
                 harrdef:=nil;
                 harrdef:=nil;
                 while assigned(plist^.next) do
                 while assigned(plist^.next) do
                   begin
                   begin