mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 03:46:10 +02:00
Fix regressions.
pgenutil.pas: * process_procdef & process_abstractrecorddef: only check whether the procdef's generic is still a forward declaration if it's in the current unit (otherwise we would trigger an internal error) git-svn-id: trunk@33828 -
This commit is contained in:
parent
ac95dcd7fa
commit
1d7c19aaf0
@ -1559,8 +1559,9 @@ uses
|
|||||||
{ only generate the code if we need a body }
|
{ only generate the code if we need a body }
|
||||||
if assigned(tprocdef(hp).struct) and not tprocdef(hp).forwarddef then
|
if assigned(tprocdef(hp).struct) and not tprocdef(hp).forwarddef then
|
||||||
continue;
|
continue;
|
||||||
{ and the body is available already }
|
{ and the body is available already (which is implicitely the
|
||||||
if tprocdef(tprocdef(hp).genericdef).forwarddef then
|
case if the generic routine is part of another unit) }
|
||||||
|
if (hmodule=current_module) and tprocdef(tprocdef(hp).genericdef).forwarddef then
|
||||||
begin
|
begin
|
||||||
result:=false;
|
result:=false;
|
||||||
continue;
|
continue;
|
||||||
@ -1602,18 +1603,23 @@ uses
|
|||||||
case def.typ of
|
case def.typ of
|
||||||
procdef:
|
procdef:
|
||||||
begin
|
begin
|
||||||
|
{ the use of forwarddef should not backfire as the
|
||||||
|
specialization always belongs to the current module }
|
||||||
if not tprocdef(def).forwarddef then
|
if not tprocdef(def).forwarddef then
|
||||||
continue;
|
continue;
|
||||||
if not assigned(def.genericdef) then
|
if not assigned(def.genericdef) then
|
||||||
internalerror(2015061903);
|
internalerror(2015061903);
|
||||||
if tprocdef(def.genericdef).forwarddef then
|
hmodule:=find_module_from_symtable(def.genericdef.owner);
|
||||||
|
if hmodule=nil then
|
||||||
|
internalerror(2015061904);
|
||||||
|
{ we need to check for a forward declaration only if the
|
||||||
|
generic was declared in the same unit (otherwise there
|
||||||
|
should be one) }
|
||||||
|
if (hmodule=current_module) and tprocdef(def.genericdef).forwarddef then
|
||||||
begin
|
begin
|
||||||
readdlist.add(def);
|
readdlist.add(def);
|
||||||
continue;
|
continue;
|
||||||
end;
|
end;
|
||||||
hmodule:=find_module_from_symtable(def.genericdef.owner);
|
|
||||||
if hmodule=nil then
|
|
||||||
internalerror(2015061904);
|
|
||||||
|
|
||||||
specialization_init(tstoreddef(def).genericdef,state);
|
specialization_init(tstoreddef(def).genericdef,state);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user