* search dynamic string data record in correct symtable in

tllvmtai_typedconstbuilder.emit_string_offset
   o fixes LLVM internalerror 2014080406 for test/tcustomattr14

git-svn-id: trunk@42464 -
This commit is contained in:
Jonas Maebe 2019-07-20 12:08:59 +00:00
parent 12e63d8a2c
commit 145f4299b4

View File

@ -412,13 +412,12 @@ implementation
procedure tllvmtai_typedconstbuilder.emit_string_offset(const ll: tasmlabofs; const strlength: longint; const st: tstringtype; const winlikewidestring: boolean; const charptrdef: tdef);
var
srsym : tsym;
srsymtable: tsymtable;
strrecdef : trecorddef;
strdef: tdef;
offset: pint;
field: tfieldvarsym;
dataptrdef: tdef;
typesym: ttypesym;
begin
{ nil pointer? }
if not assigned(ll.lab) then
@ -434,9 +433,10 @@ implementation
if ll.ofs<>0 then
begin
{ get the recorddef for this string constant }
if not searchsym_type(ctai_typedconstbuilder.get_dynstring_rec_name(st,winlikewidestring,strlength),srsym,srsymtable) then
typesym:=try_search_current_module_type(ctai_typedconstbuilder.get_dynstring_rec_name(st,winlikewidestring,strlength));
if not assigned(typesym) then
internalerror(2014080406);
strrecdef:=trecorddef(ttypesym(srsym).typedef);
strrecdef:=trecorddef(typesym.typedef);
{ offset in the record of the the string data }
offset:=ctai_typedconstbuilder.get_string_symofs(st,winlikewidestring);
{ field corresponding to this offset }