Bläddra i källkod

* 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 -

Jonas Maebe 6 år sedan
förälder
incheckning
145f4299b4
1 ändrade filer med 4 tillägg och 4 borttagningar
  1. 4 4
      compiler/llvm/nllvmtcon.pas

+ 4 - 4
compiler/llvm/nllvmtcon.pas

@@ -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 }