浏览代码

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 -
svenbarth 9 年之前
父节点
当前提交
fd98ec56e9
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      compiler/pgenutil.pas

+ 2 - 2
compiler/pgenutil.pas

@@ -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;