Fix (hopefully last) regression introduced due to the reworking specialization of routine bodies.

pgenutil.pas:
  * process_abstractrecorddef & generate_specialization_procs: also check for a forward def is the other module is still compiling (thus an access to tprocdef.forwarddef should still be possible); this might happen due to circular references like in tests/test/tgeneric91.pp

git-svn-id: trunk@33872 -
This commit is contained in:
svenbarth 2016-06-01 19:03:54 +00:00
parent 77318be022
commit fd98ec56e9

View File

@ -1563,7 +1563,7 @@ uses
continue;
{ and the body is available already (which is implicitely the
case if the generic routine is part of another unit) }
if (hmodule=current_module) and tprocdef(tprocdef(hp).genericdef).forwarddef then
if ((hmodule=current_module) or (hmodule.state=ms_compile)) and tprocdef(tprocdef(hp).genericdef).forwarddef then
begin
result:=false;
continue;
@ -1617,7 +1617,7 @@ uses
{ 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
if ((hmodule=current_module) or (hmodule.state=ms_compile)) and tprocdef(def.genericdef).forwarddef then
begin
readdlist.add(def);
continue;