From 6e09fcb744c12b38efc3bce1a8dcaba38f39c9f0 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Wed, 13 Aug 2014 19:25:45 +0000 Subject: [PATCH] * fixed ansi/unicodestring constants on non-llvm/darwin platforms after r28327 git-svn-id: branches/hlcgllvm@28404 - --- compiler/aasmcnst.pas | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/compiler/aasmcnst.pas b/compiler/aasmcnst.pas index 682615eab7..250ac695f4 100644 --- a/compiler/aasmcnst.pas +++ b/compiler/aasmcnst.pas @@ -534,6 +534,7 @@ implementation function ttai_lowleveltypedconstbuilder.emit_string_const_common(list: TAsmList; stringtype: tstringtype; len: asizeint; encoding: tstringencoding; out startlab: tasmlabel): tasmlabofs; var string_symofs: asizeint; + charptrdef: tdef; elesize: word; begin current_asmdata.getdatalabel(result.lab); @@ -547,9 +548,15 @@ implementation { element size } case stringtype of st_ansistring: - elesize:=1; + begin + elesize:=1; + charptrdef:=charpointertype; + end; st_unicodestring: - elesize:=2; + begin + elesize:=2; + charptrdef:=widecharpointertype; + end else internalerror(2014080401); end; @@ -567,7 +574,7 @@ implementation if string_symofs=0 then begin { results in slightly more efficient code } - list.concat(tai_label.create(result.lab)); + emit_tai(tai_label.create(result.lab),charptrdef); result.ofs:=0; current_asmdata.getdatalabel(startlab); end;