* always search in the current module as well as its symtables are be popped already in case of RTTI generation

git-svn-id: trunk@39688 -
This commit is contained in:
svenbarth 2018-08-29 19:21:28 +00:00
parent 190716ac0e
commit ecc02f3fdb

View File

@ -1335,12 +1335,21 @@ implementation
srsym: tsym;
srsymtable: tsymtable;
i: longint;
name : TIDString;
begin
if searchsym_type(copy(internaltypeprefixName[prefix],2,length(internaltypeprefixName[prefix])),srsym,srsymtable) then
name:=copy(internaltypeprefixName[prefix],2,length(internaltypeprefixName[prefix]));
if searchsym_type(name,srsym,srsymtable) then
begin
result:=trecorddef(ttypesym(srsym).typedef);
exit
end;
{ also always search in the current module (symtables are popped for
RTTI related code already) }
if searchsym_in_module(pointer(current_module),name,srsym,srsymtable) then
begin
result:=trecorddef(ttypesym(srsym).typedef);
exit;
end;
fieldlist:=tfplist.create;
for i:=low(fields) to high(fields) do
fieldlist.add(fields[i]);
@ -1368,6 +1377,14 @@ implementation
arrdef:=tarraydef(trecordsymtable(recdef.symtable).findfieldbyoffset(countdef.size).vardef);
exit
end;
{ also always search in the current module (symtables are popped for
RTTI related code already) }
if searchsym_in_module(pointer(current_module),copy(name,2,length(name)),srsym,srsymtable) then
begin
recdef:=trecorddef(ttypesym(srsym).typedef);
arrdef:=tarraydef(trecordsymtable(recdef.symtable).findfieldbyoffset(countdef.size).vardef);
exit;
end;
recdef:=crecorddef.create_global_internal(name,packrecords,
targetinfos[target_info.system]^.alignment.recordalignmin,
targetinfos[target_info.system]^.alignment.maxCrecordalign);