Browse Source

+ fill the treference.segment in tcgtypeconvnode.second_pointer_to_array when
the source type is a far (or huge) pointer

git-svn-id: trunk@27279 -

nickysn 11 years ago
parent
commit
bd75abb64b
1 changed files with 9 additions and 1 deletions
  1. 9 1
      compiler/ncgcnv.pas

+ 9 - 1
compiler/ncgcnv.pas

@@ -363,6 +363,10 @@ interface
               else
               else
             {$endif}
             {$endif}
                 location.reference.base := left.location.register;
                 location.reference.base := left.location.register;
+{$ifdef i8086}
+              if is_farpointer(left.resultdef) or is_hugepointer(left.resultdef) then
+                location.reference.segment := GetNextReg(left.location.register);
+{$endif i8086}
             end;
             end;
           LOC_REFERENCE,
           LOC_REFERENCE,
           LOC_CREFERENCE,
           LOC_CREFERENCE,
@@ -372,9 +376,13 @@ interface
           LOC_SUBSETREF,
           LOC_SUBSETREF,
           LOC_CSUBSETREF:
           LOC_CSUBSETREF:
             begin
             begin
-              location.reference.base:=cg.getaddressregister(current_asmdata.CurrAsmList);
+              location.reference.base:=hlcg.getaddressregister(current_asmdata.CurrAsmList,left.resultdef);
               hlcg.a_load_loc_reg(current_asmdata.CurrAsmList,left.resultdef,left.resultdef,left.location,
               hlcg.a_load_loc_reg(current_asmdata.CurrAsmList,left.resultdef,left.resultdef,left.location,
                 location.reference.base);
                 location.reference.base);
+{$ifdef i8086}
+              if is_farpointer(left.resultdef) or is_hugepointer(left.resultdef) then
+                location.reference.segment := GetNextReg(location.reference.base);
+{$endif i8086}
               if left.location.loc in [LOC_REFERENCE,LOC_CREFERENCE] then
               if left.location.loc in [LOC_REFERENCE,LOC_CREFERENCE] then
                 location_freetemp(current_asmdata.CurrAsmList,left.location);
                 location_freetemp(current_asmdata.CurrAsmList,left.location);
             end;
             end;