Bladeren bron

* fixed the handling of Ofs(x) typed constants on i8086; previously, they would
sometimes produce a far pointer constant (depending on the memory model and
the type of 'x'), which would accidentally work for single constants, but will
fail for consts, which are a part of a record or an array. This fixes e.g.
const c:array[0..1] of word=(Ofs(a),Ofs(b)); in all memory models

git-svn-id: trunk@38121 -

nickysn 7 jaren geleden
bovenliggende
commit
fe7fb70e2c
1 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 3 3
      compiler/i8086/n8086tcon.pas

+ 3 - 3
compiler/i8086/n8086tcon.pas

@@ -110,12 +110,12 @@ uses
                       if po_abstractmethod in pd.procoptions then
                         Message(type_e_cant_take_address_of_abstract_method)
                       else
-                        ftcb.emit_tai(Tai_const.Createname(pd.mangledname,0),u16inttype);
+                        ftcb.emit_tai(Tai_const.Createname_near(pd.mangledname,0),u16inttype);
                     end;
                   staticvarsym :
-                    ftcb.emit_tai(Tai_const.Createname(tstaticvarsym(srsym).mangledname,0),u16inttype);
+                    ftcb.emit_tai(Tai_const.Createname_near(tstaticvarsym(srsym).mangledname,0),u16inttype);
                   labelsym :
-                    ftcb.emit_tai(Tai_const.Createname(tlabelsym(srsym).mangledname,0),u16inttype);
+                    ftcb.emit_tai(Tai_const.Createname_near(tlabelsym(srsym).mangledname,0),u16inttype);
                   else
                     Message(type_e_variable_id_expected);
                 end;