From 919c539ff51d7a254c29f62165c7f3d3529fbd0c Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 13 Jun 2015 16:50:55 +0000 Subject: [PATCH] * better estimation of callparanode complexity git-svn-id: trunk@31038 - --- compiler/nutils.pas | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/compiler/nutils.pas b/compiler/nutils.pas index 863c934c3f..3c0413aef6 100644 --- a/compiler/nutils.pas +++ b/compiler/nutils.pas @@ -737,9 +737,24 @@ implementation p := tunarynode(p).left; end; labeln, - blockn, - callparan: + blockn: p := tunarynode(p).left; + callparan: + begin + { call to decr? } + if is_managed_type(tunarynode(p).left.resultdef) and (tcallparanode(p).parasym.varspez=vs_out) then + begin + result:=NODE_COMPLEXITY_INF; + exit; + end + else + begin + inc(result); + if (result = NODE_COMPLEXITY_INF) then + exit; + p := tunarynode(p).left; + end; + end; notn, derefn : begin