Browse Source

+ support 6-byte records in registers in thlcgcpu.location_force_mem on the i8086; this fixes the handling of methodpointers typecasted to record (TMethod) in medium and compact memory models

git-svn-id: trunk@25500 -
nickysn 12 years ago
parent
commit
a5284881f5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      compiler/i8086/hlcgcpu.pas

+ 2 - 2
compiler/i8086/hlcgcpu.pas

@@ -201,12 +201,12 @@ implementation
       r,tmpref: treference;
     begin
       { handle i8086 6-byte (mixed near + far) method pointers }
-      if (size.typ=procvardef) and (size.size=6) and (l.loc in [LOC_REGISTER,LOC_CREGISTER]) then
+      if (size.typ in [procvardef,recorddef]) and (size.size=6) and (l.loc in [LOC_REGISTER,LOC_CREGISTER]) then
         begin
           tg.gethltemp(list,size,size.size,tt_normal,r);
           tmpref:=r;
 
-          if po_far in tprocvardef(size).procoptions then
+          if current_settings.x86memorymodel in x86_far_code_models then
             begin
               cg.a_load_reg_ref(list,OS_32,OS_32,l.register,tmpref);
               inc(tmpref.offset,4);