From 5e6dddad3e0405bb78066ebb347e790db2c176be Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Thu, 13 May 2021 16:59:05 +0100 Subject: [PATCH] Replace count(getReceiver()) with 1 --- .../codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll b/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll index d8762f66cc8..0415e8339cd 100644 --- a/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll +++ b/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll @@ -915,9 +915,9 @@ module Trees { final override ControlFlowTree getChildNode(int i) { result = this.getReceiver() and i = 0 or - result = this.getArgument(i - count(this.getReceiver())) + result = this.getArgument(i - 1) or - result = this.getBlock() and i = count(this.getReceiver()) + this.getNumberOfArguments() + result = this.getBlock() and i = 1 + this.getNumberOfArguments() } }