From fe7fb70e2c7eb245f8c658fc738694288cb67ab9 Mon Sep 17 00:00:00 2001 From: nickysn Date: Mon, 5 Feb 2018 16:12:20 +0000 Subject: [PATCH] * 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 - --- compiler/i8086/n8086tcon.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/i8086/n8086tcon.pas b/compiler/i8086/n8086tcon.pas index 286f556fe6..13f284d535 100644 --- a/compiler/i8086/n8086tcon.pas +++ b/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;