* ensure that the llvmst is initialised before using a field's llvmfieldnr

(and at the same time take advantage of this to perform a sanity check)

git-svn-id: trunk@31061 -
This commit is contained in:
Jonas Maebe 2015-06-13 22:48:40 +00:00
parent 89c4bd8522
commit b176ed9f80

View File

@ -99,6 +99,7 @@ implementation
srsymtable: tsymtable;
offset: pint;
field: tfieldvarsym;
llvmfield: tllvmshadowsymtableentry;
dataptrdef: tdef;
reg: tregister;
href: treference;
@ -121,6 +122,9 @@ implementation
offset:=ctai_typedconstbuilder.get_string_symofs(stringtype,winlikewidestring);
{ field corresponding to this offset }
field:=trecordsymtable(strrecdef.symtable).findfieldbyoffset(offset);
llvmfield:=trecordsymtable(strrecdef.symtable).llvmst[field];
if llvmfield.fieldoffset<>field.fieldoffset then
internalerror(2015061001);
{ pointerdef to the string data array }
dataptrdef:=getpointerdef(field.vardef);
{ load the address of the string data }