Bladeren bron

* avoid a crash when processing synthetic methods of specialised classes:
these are generated after the other specialisation methods (via
add_synthetic_method_implementations, rather than via
generate_specialization_procs)
o fixes crash in tests/test/jvm/tw20212.pp

git-svn-id: trunk@34036 -

Jonas Maebe 9 jaren geleden
bovenliggende
commit
95f28e5e0c
1 gewijzigde bestanden met toevoegingen van 5 en 1 verwijderingen
  1. 5 1
      compiler/pgenutil.pas

+ 5 - 1
compiler/pgenutil.pas

@@ -1563,7 +1563,11 @@ 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) or (hmodule.state=ms_compile)) and tprocdef(tprocdef(hp).genericdef).forwarddef then
+               if ((hmodule=current_module) or (hmodule.state=ms_compile)) and
+                  { may not be assigned in case it's a synthetic procdef that
+                    still needs to be generated }
+                  assigned(tprocdef(hp).genericdef) and
+                  tprocdef(tprocdef(hp).genericdef).forwarddef then
                  begin
                    result:=false;
                    continue;