From 0f15664ffaccbd06005532bbdd7476316bd18ee2 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 20 Aug 2011 08:14:45 +0000 Subject: [PATCH] * check whether symtablestack.top is a javaclass/interface rather than pd.struct to determine whether a directive is allowed or not, because pd.struct is also set for nested routines (also has to be changed for objcclass) git-svn-id: branches/jvmbackend@18608 - --- compiler/pdecsub.pas | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas index edf4b0cd70..4207a05f79 100644 --- a/compiler/pdecsub.pas +++ b/compiler/pdecsub.pas @@ -2652,6 +2652,16 @@ const (symtablestack.top.symtabletype=recordsymtable) then exit; + { check if method and directive not for java class } + if not(pd_javaclass in proc_direcdata[p].pd_flags) and + is_javaclass(tdef(symtablestack.top.defowner)) then + exit; + + { check if method and directive not for java interface } + if not(pd_intfjava in proc_direcdata[p].pd_flags) and + is_javainterface(tdef(symtablestack.top.defowner)) then + exit; + { Conflicts between directives ? } if (pd.proctypeoption in proc_direcdata[p].mutexclpotype) or (pd.proccalloption in proc_direcdata[p].mutexclpocall) or @@ -2716,17 +2726,6 @@ const { check if method and directive not for record/class helper } if is_objectpascal_helper(tprocdef(pd).struct) and (pd_nothelper in proc_direcdata[p].pd_flags) then - - { check if method and directive not for java class } - if is_javaclass(tprocdef(pd).struct) and - not(pd_javaclass in proc_direcdata[p].pd_flags) then - exit; - - { check if method and directive not for java interface } - if is_javainterface(tprocdef(pd).struct) and - not(pd_intfjava in proc_direcdata[p].pd_flags) then - exit; - end; { consume directive, and turn flag on }