From 99177a75fbb137608e1a841e7997cdba487b35ab Mon Sep 17 00:00:00 2001 From: Jonas Maebe <jonas@freepascal.org> Date: Sat, 20 Aug 2011 08:04:35 +0000 Subject: [PATCH] * tprocdef -> tabstractprocdef typecasts so the code will also work when calling procvars is supported git-svn-id: branches/jvmbackend@18495 - --- compiler/jvm/njvmcal.pas | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/jvm/njvmcal.pas b/compiler/jvm/njvmcal.pas index 3e68edbc8e..c11b664516 100644 --- a/compiler/jvm/njvmcal.pas +++ b/compiler/jvm/njvmcal.pas @@ -65,11 +65,11 @@ implementation already been done before calling the current constructor) } if procdefinition.typ<>procdef then exit; - if tprocdef(procdefinition).proctypeoption<>potype_constructor then + if tabstractprocdef(procdefinition).proctypeoption<>potype_constructor then exit; if not(methodpointer.resultdef.typ in [classrefdef,recorddef]) then exit; - current_asmdata.CurrAsmList.concat(taicpu.op_sym(a_new,current_asmdata.RefAsmSymbol(tabstractrecorddef(tprocdef(procdefinition).owner.defowner).jvm_full_typename(true)))); + current_asmdata.CurrAsmList.concat(taicpu.op_sym(a_new,current_asmdata.RefAsmSymbol(tabstractrecorddef(tabstractprocdef(procdefinition).owner.defowner).jvm_full_typename(true)))); { the constructor doesn't return anything, so put a duplicate of the self pointer on the evaluation stack for use as function result after the constructor has run } @@ -92,7 +92,7 @@ implementation procedure tjvmcallnode.do_release_unused_return_value; begin - if (tprocdef(procdefinition).proctypeoption=potype_constructor) and + if (tabstractprocdef(procdefinition).proctypeoption=potype_constructor) and (current_procinfo.procdef.proctypeoption=potype_constructor) then exit; case resultdef.size of @@ -124,7 +124,7 @@ implementation else realresdef:=tstoreddef(typedef); { a constructor doesn't actually return a value in the jvm } - if (tprocdef(procdefinition).proctypeoption=potype_constructor) then + if (tabstractprocdef(procdefinition).proctypeoption=potype_constructor) then totalremovesize:=pushedparasize else { even a byte takes up a full stackslot -> align size to multiple of 4 } @@ -138,7 +138,7 @@ implementation { if this was an inherited constructor call, initialise all fields that are wrapped types following it } - if (tprocdef(procdefinition).proctypeoption=potype_constructor) and + if (tabstractprocdef(procdefinition).proctypeoption=potype_constructor) and (cnf_inherited in callnodeflags) then thlcgjvm(hlcg).gen_initialize_fields_code(current_asmdata.CurrAsmList); end;