mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-21 03:49:18 +02:00
* fix for Mantis #23071: also store local symtable in the PPU if the procdef is generic as we need it to resolve genericdefs to nested types
git-svn-id: trunk@42459 -
This commit is contained in:
parent
4d6844e731
commit
43b5dbf613
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -15980,6 +15980,7 @@ tests/webtbs/tw2300.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw2305.pp svneol=native#text/plain
|
tests/webtbs/tw2305.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2306.pp svneol=native#text/plain
|
tests/webtbs/tw2306.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2307.pp svneol=native#text/plain
|
tests/webtbs/tw2307.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw23071.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw23109.pp svneol=native#text/plain
|
tests/webtbs/tw23109.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2311.pp svneol=native#text/plain
|
tests/webtbs/tw2311.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw23130.pp svneol=native#text/pascal
|
tests/webtbs/tw23130.pp svneol=native#text/pascal
|
||||||
@ -17224,6 +17225,7 @@ tests/webtbs/uw2266b.pas svneol=native#text/plain
|
|||||||
tests/webtbs/uw2269.inc svneol=native#text/plain
|
tests/webtbs/uw2269.inc svneol=native#text/plain
|
||||||
tests/webtbs/uw22741a.pp svneol=native#text/plain
|
tests/webtbs/uw22741a.pp svneol=native#text/plain
|
||||||
tests/webtbs/uw22741b.pp svneol=native#text/plain
|
tests/webtbs/uw22741b.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/uw23071.pp svneol=native#text/pascal
|
||||||
tests/webtbs/uw23204.pp svneol=native#text/plain
|
tests/webtbs/uw23204.pp svneol=native#text/plain
|
||||||
tests/webtbs/uw2364.pp svneol=native#text/plain
|
tests/webtbs/uw2364.pp svneol=native#text/plain
|
||||||
tests/webtbs/uw25054a.pp svneol=native#text/pascal
|
tests/webtbs/uw25054a.pp svneol=native#text/pascal
|
||||||
|
@ -773,6 +773,8 @@ interface
|
|||||||
procdef has been handled }
|
procdef has been handled }
|
||||||
implprocdefinfo : pimplprocdefinfo;
|
implprocdefinfo : pimplprocdefinfo;
|
||||||
|
|
||||||
|
function store_localst:boolean;
|
||||||
|
|
||||||
function GetResultName: PShortString;
|
function GetResultName: PShortString;
|
||||||
procedure SetResultName(AValue: PShortString);
|
procedure SetResultName(AValue: PShortString);
|
||||||
function GetParentFPStruct: tsym;
|
function GetParentFPStruct: tsym;
|
||||||
@ -5716,6 +5718,13 @@ implementation
|
|||||||
TPROCDEF
|
TPROCDEF
|
||||||
***************************************************************************}
|
***************************************************************************}
|
||||||
|
|
||||||
|
|
||||||
|
function tprocdef.store_localst: boolean;
|
||||||
|
begin
|
||||||
|
result:=has_inlininginfo or (df_generic in defoptions);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function tprocdef.GetResultName: PShortString;
|
function tprocdef.GetResultName: PShortString;
|
||||||
begin
|
begin
|
||||||
if not assigned(implprocdefinfo) then
|
if not assigned(implprocdefinfo) then
|
||||||
@ -6039,7 +6048,7 @@ implementation
|
|||||||
parast:=tparasymtable.create(self,level);
|
parast:=tparasymtable.create(self,level);
|
||||||
tparasymtable(parast).ppuload(ppufile);
|
tparasymtable(parast).ppuload(ppufile);
|
||||||
{ load local symtable }
|
{ load local symtable }
|
||||||
if has_inlininginfo then
|
if store_localst then
|
||||||
begin
|
begin
|
||||||
localst:=tlocalsymtable.create(self,level);
|
localst:=tlocalsymtable.create(self,level);
|
||||||
tlocalsymtable(localst).ppuload(ppufile);
|
tlocalsymtable(localst).ppuload(ppufile);
|
||||||
@ -6221,7 +6230,7 @@ implementation
|
|||||||
|
|
||||||
{ save localsymtable for inline procedures or when local
|
{ save localsymtable for inline procedures or when local
|
||||||
browser info is requested, this has no influence on the crc }
|
browser info is requested, this has no influence on the crc }
|
||||||
if has_inlininginfo then
|
if store_localst and not ppufile.crc_only then
|
||||||
begin
|
begin
|
||||||
oldintfcrc:=ppufile.do_crc;
|
oldintfcrc:=ppufile.do_crc;
|
||||||
ppufile.do_crc:=false;
|
ppufile.do_crc:=false;
|
||||||
@ -6512,16 +6521,16 @@ implementation
|
|||||||
begin
|
begin
|
||||||
inherited buildderefimpl;
|
inherited buildderefimpl;
|
||||||
|
|
||||||
{ inline tree }
|
|
||||||
if has_inlininginfo then
|
|
||||||
begin
|
|
||||||
{ Localst is not available for main/unit init }
|
{ Localst is not available for main/unit init }
|
||||||
if assigned(localst) then
|
if store_localst and assigned(localst) then
|
||||||
begin
|
begin
|
||||||
tlocalsymtable(localst).buildderef;
|
tlocalsymtable(localst).buildderef;
|
||||||
tlocalsymtable(localst).buildderefimpl;
|
tlocalsymtable(localst).buildderefimpl;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ inline tree }
|
||||||
|
if has_inlininginfo then
|
||||||
|
begin
|
||||||
funcretsymderef.build(funcretsym);
|
funcretsymderef.build(funcretsym);
|
||||||
inlininginfo^.code.buildderefimpl;
|
inlininginfo^.code.buildderefimpl;
|
||||||
end;
|
end;
|
||||||
@ -6546,16 +6555,16 @@ implementation
|
|||||||
if assigned(inlininginfo) then
|
if assigned(inlininginfo) then
|
||||||
has_inlininginfo:=true;
|
has_inlininginfo:=true;
|
||||||
|
|
||||||
{ Inline }
|
|
||||||
if has_inlininginfo then
|
|
||||||
begin
|
|
||||||
{ Locals }
|
{ Locals }
|
||||||
if assigned(localst) then
|
if store_localst and assigned(localst) then
|
||||||
begin
|
begin
|
||||||
tlocalsymtable(localst).deref(false);
|
tlocalsymtable(localst).deref(false);
|
||||||
tlocalsymtable(localst).derefimpl(false);
|
tlocalsymtable(localst).derefimpl(false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ Inline }
|
||||||
|
if has_inlininginfo then
|
||||||
|
begin
|
||||||
inlininginfo^.code.derefimpl;
|
inlininginfo^.code.derefimpl;
|
||||||
{ funcretsym, this is always located in the localst }
|
{ funcretsym, this is always located in the localst }
|
||||||
funcretsym:=tsym(funcretsymderef.resolve);
|
funcretsym:=tsym(funcretsymderef.resolve);
|
||||||
|
10
tests/webtbs/tw23071.pp
Normal file
10
tests/webtbs/tw23071.pp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{ %NORUN }
|
||||||
|
{ %RECOMPILE }
|
||||||
|
|
||||||
|
{$MODE DELPHI}
|
||||||
|
|
||||||
|
uses uw23071;
|
||||||
|
|
||||||
|
begin
|
||||||
|
TWrapper<Byte>.Z;
|
||||||
|
end.
|
20
tests/webtbs/uw23071.pp
Normal file
20
tests/webtbs/uw23071.pp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
unit uw23071;
|
||||||
|
|
||||||
|
{$MODE DELPHI}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
type
|
||||||
|
TWrapper<T> = record
|
||||||
|
class procedure Z; static;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
class procedure TWrapper<T>.Z;
|
||||||
|
type
|
||||||
|
TLocalInteger = Integer;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user