From 7def77dcc98342ab8fb41f21a737be388d226ce2 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 12 Sep 2015 23:33:17 +0000 Subject: [PATCH] * we only support resourcestrings in ttai_typedconstbuilder.queue_emit_const() right now, so give an internalerror if something else is passed * use the correct type when emitting a resourcestring like that (it will store the address of the resource string -> pointer to an ansistring) git-svn-id: trunk@31646 - --- compiler/aasmcnst.pas | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/compiler/aasmcnst.pas b/compiler/aasmcnst.pas index 5ad7832dc6..169bbb5739 100644 --- a/compiler/aasmcnst.pas +++ b/compiler/aasmcnst.pas @@ -1570,7 +1570,18 @@ implementation if fqueue_offset<>0 then internalerror(2014062103); { warning: update if/when the type of resource strings changes } - emit_tai(Tai_const.Createname(make_mangledname('RESSTR',cs.owner,cs.name),AT_DATA,sizeof(pint)),cansistringtype); + case cs.consttyp of + constresourcestring: + emit_tai(Tai_const.Createname(make_mangledname('RESSTR',cs.owner,cs.name),AT_DATA,sizeof(pint)),cpointerdef.getreusable(cansistringtype)); + { can these occur? } + constord, + conststring,constreal, + constset,constpointer,constnil, + constwstring,constguid: + internalerror(2015090903); + else + internalerror(2015090904); + end; fqueue_offset:=low(fqueue_offset); end;