فهرست منبع

* fix inline assembly of segment:localvar with the internal asm writer on x86

git-svn-id: trunk@38475 -
nickysn 7 سال پیش
والد
کامیت
c0b7aec2c4
1فایلهای تغییر یافته به همراه17 افزوده شده و 1 حذف شده
  1. 17 1
      compiler/ncgbas.pas

+ 17 - 1
compiler/ncgbas.pas

@@ -330,6 +330,10 @@ interface
                                      ReLabel(ref^.symbol);
                                    if assigned(ref^.relsymbol) then
                                      ReLabel(ref^.relsymbol);
+{$ifdef x86}
+                                   if (ref^.segment<>NR_NO) and (ref^.segment<>get_default_segment_of_ref(ref^)) then
+                                     taicpu(hp2).segprefix:=ref^.segment;
+{$endif x86}
                                  end;
                              end;
                            end;
@@ -364,7 +368,19 @@ interface
 {$endif}
                        { fixup the references }
                        for i:=1 to taicpu(hp).ops do
-                         ResolveRef(taicpu(hp).fileinfo,taicpu(hp).oper[i-1]^);
+                         begin
+                           ResolveRef(taicpu(hp).fileinfo,taicpu(hp).oper[i-1]^);
+{$ifdef x86}
+                           with taicpu(hp).oper[i-1]^ do
+                             begin
+                               case typ of
+                                 top_ref :
+                                   if (ref^.segment<>NR_NO) and (ref^.segment<>get_default_segment_of_ref(ref^)) then
+                                     taicpu(hp).segprefix:=ref^.segment;
+                               end;
+                             end;
+{$endif x86}
+                         end;
 {$ifdef x86}
                       { can only be checked now that all local operands }
                       { have been resolved                              }