From 482b83c3cb2a6dfe442180cd2873bf6cd092d6ae Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 6 Jan 2008 15:30:04 +0000 Subject: [PATCH] * typecheckpass before calling do_simplify, as the siplify methods assume that the resultdefs are available git-svn-id: trunk@9652 - --- compiler/ncal.pas | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/compiler/ncal.pas b/compiler/ncal.pas index 1e8969ff89..9ba8a444aa 100644 --- a/compiler/ncal.pas +++ b/compiler/ncal.pas @@ -1070,7 +1070,7 @@ implementation begin { Need to use a hack here to prevent the parameters from being copied. The parameters must be copied between callinitblock/callcleanupblock because - the can reference methodpointer } + they can reference methodpointer } oldleft:=left; left:=nil; n:=tcallnode(inherited dogetcopy); @@ -2661,10 +2661,17 @@ implementation gen_hidden_parameters; { Remove useless nodes from init/final blocks } + { (simplify depends on typecheck info) } if assigned(callinitblock) then - dosimplify(callinitblock); + begin + typecheckpass(callinitblock); + dosimplify(callinitblock); + end; if assigned(callcleanupblock) then - dosimplify(callcleanupblock); + begin + typecheckpass(callcleanupblock); + dosimplify(callcleanupblock); + end; { Continue with checking a normal call or generate the inlined code } if cnf_do_inline in callnodeflags then @@ -3167,6 +3174,7 @@ implementation { consider it must not be inlined if called again inside the args or itself } exclude(procdefinition.procoptions,po_inline); + typecheckpass(inlineblock); dosimplify(inlineblock); firstpass(inlineblock); include(procdefinition.procoptions,po_inline);