From 95f28e5e0c9e8abdca3ce264b672eeddd8e2e031 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Thu, 30 Jun 2016 15:33:54 +0000 Subject: [PATCH] * 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 - --- compiler/pgenutil.pas | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/pgenutil.pas b/compiler/pgenutil.pas index 5d142d5835..9fc7bab5cf 100644 --- a/compiler/pgenutil.pas +++ b/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;