From cfe125198c4aaea9e345652136c400bc652e5a24 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 20 Aug 2011 08:21:01 +0000 Subject: [PATCH] * always return true from tjvmnodeutils.force_init(), because when this routine is called we don't know yet whether it has to be forced or not for the JVM target (staticvarsyms that need initialization may still be created during pass1 of the main program/unit code) git-svn-id: branches/jvmbackend@18646 - --- compiler/jvm/njvmutil.pas | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/jvm/njvmutil.pas b/compiler/jvm/njvmutil.pas index 302bc14978..9de3feacec 100644 --- a/compiler/jvm/njvmutil.pas +++ b/compiler/jvm/njvmutil.pas @@ -105,10 +105,11 @@ implementation class function tjvmnodeutils.force_init: boolean; begin { we need an initialisation in case the al_globals list is not empty - (that's where the initialisation for global records is added) } - result:= - inherited or - not current_asmdata.asmlists[al_globals].empty; + (that's where the initialisation for global records etc is added) } + { problem: some bss symbols are only registered while processing the main + program (e.g. constant sets) -> cannot predict whether or not we'll + need it in advance } + result:=true; end; class procedure tjvmnodeutils.insertbssdata(sym: tstaticvarsym);