* use ctai_typedconstbuilder.get_dynstring_rec() to get the recorddef representing

string constants instead of giving an internal error if we can't find it in
    the current context (in most cases it will exist, but not when inlining a
    routine from another unit that accesses a locally declared string constant)

git-svn-id: trunk@34373 -
This commit is contained in:
Jonas Maebe 2016-08-24 16:41:04 +00:00
parent 4a42d67b72
commit 18a59dddb9

View File

@ -95,8 +95,6 @@ implementation
var
stringtype: tstringtype;
strrecdef: trecorddef;
srsym: tsym;
srsymtable: tsymtable;
offset: pint;
field: tfieldvarsym;
llvmfield: tllvmshadowsymtableentry;
@ -115,9 +113,7 @@ implementation
internalerror(2014040804);
end;
{ get the recorddef for this string constant }
if not searchsym_type(ctai_typedconstbuilder.get_dynstring_rec_name(stringtype,winlikewidestring,len),srsym,srsymtable) then
internalerror(2014080405);
strrecdef:=trecorddef(ttypesym(srsym).typedef);
strrecdef:=ctai_typedconstbuilder.get_dynstring_rec(stringtype,winlikewidestring,len);
{ offset in the record of the the string data }
offset:=ctai_typedconstbuilder.get_string_symofs(stringtype,winlikewidestring);
{ field corresponding to this offset }