From 6fc930a0fc30a339624476fe1f0f79a261632387 Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 21 Oct 2020 20:46:28 +0000 Subject: [PATCH] * better complexity calculation of tvecnodes git-svn-id: trunk@47151 - --- compiler/nutils.pas | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/compiler/nutils.pas b/compiler/nutils.pas index d05fac310a..78d9ecec2d 100644 --- a/compiler/nutils.pas +++ b/compiler/nutils.pas @@ -872,7 +872,17 @@ implementation exit; p := tunarynode(p).left; end; - vecn, + vecn: + begin + inc(result,node_complexity(tbinarynode(p).left)); + inc(result); + if (result >= NODE_COMPLEXITY_INF) then + begin + result := NODE_COMPLEXITY_INF; + exit; + end; + p := tbinarynode(p).right; + end; statementn: begin inc(result,node_complexity(tbinarynode(p).left));