* index the llvm shadow symtable with a fieldvarsym rather than with the

index of the corresponding llvm fieldvar, as this index is a member
    of the fieldvarsym that only gets initialised once the llvm shadow
    symtable gets built, which in turn is triggered by trying to access
    it for the first time -> if fieldvarsym.llvmfieldnr got loaded by
    the compiler before evaluating the llvmst expression and if the
    llvmst hadn't been built yet, this llvmfieldnr was not yet initialized

git-svn-id: trunk@31060 -
This commit is contained in:
Jonas Maebe 2015-06-13 22:48:37 +00:00
parent 494206fd6a
commit 89c4bd8522
3 changed files with 6 additions and 6 deletions

View File

@ -114,7 +114,7 @@ implementation
end;
{ get the type of the corresponding field in the llvm shadow
definition }
llvmfielddef:=tabstractrecordsymtable(tabstractrecorddef(currentstructdef).symtable).llvmst[vs.llvmfieldnr].def;
llvmfielddef:=tabstractrecordsymtable(tabstractrecorddef(currentstructdef).symtable).llvmst[vs].def;
if implicitpointer then
subscriptdef:=currentstructdef
else

View File

@ -393,7 +393,7 @@ implementation
begin
{ update range checking info }
inherited;
llvmfielddef:=tabstractrecordsymtable(def.symtable).llvmst[vs.llvmfieldnr].def;
llvmfielddef:=tabstractrecordsymtable(def.symtable).llvmst[vs].def;
{ get the address of the llvm-struct field that corresponds to this
Pascal field }
getllvmfieldaddr:=taillvm.getelementptr_reg_tai_size_const(NR_NO,nil,s32inttype,vs.llvmfieldnr,true);

View File

@ -154,7 +154,7 @@ interface
equivst: tabstractrecordsymtable;
curroffset: aint;
recordalignmin: shortint;
function get(index: longint): tllvmshadowsymtableentry;
function get(f: tfieldvarsym): tllvmshadowsymtableentry;
public
symdeflist: TFPObjectList;
@ -169,7 +169,7 @@ interface
procedure addalignmentpadding(finalsize: aint);
procedure buildmapping(variantstarts: tfplist);
procedure buildtable(variantstarts: tfplist);
property items[index: longint]: tllvmshadowsymtableentry read get; default;
property items[index: tfieldvarsym]: tllvmshadowsymtableentry read get; default;
end;
{$endif llvm}
@ -1686,9 +1686,9 @@ implementation
TLlvmShadowSymtable
****************************************************************************}
function tllvmshadowsymtable.get(index: longint): tllvmshadowsymtableentry;
function tllvmshadowsymtable.get(f: tfieldvarsym): tllvmshadowsymtableentry;
begin
result:=tllvmshadowsymtableentry(symdeflist[index])
result:=tllvmshadowsymtableentry(symdeflist[f.llvmfieldnr])
end;