From 46b21af3ef7fea4a15991aadc790f9c404113d3e Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 24 Apr 2025 10:58:02 +0200 Subject: [PATCH] Dataflow: Make default field flow branch limit configurable per language --- shared/dataflow/codeql/dataflow/DataFlow.qll | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shared/dataflow/codeql/dataflow/DataFlow.qll b/shared/dataflow/codeql/dataflow/DataFlow.qll index 0d78d13c884..93327f5ad6a 100644 --- a/shared/dataflow/codeql/dataflow/DataFlow.qll +++ b/shared/dataflow/codeql/dataflow/DataFlow.qll @@ -342,6 +342,9 @@ signature module InputSig { any() } + /** Gets the default value for the `fieldFlowBranchLimit` */ + default int defaultFieldFlowBranchLimit() { result = 2 } + /** Holds if `fieldFlowBranchLimit` should be ignored for flow going into/out of `c`. */ default predicate ignoreFieldFlowBranchLimit(DataFlowCallable c) { none() } } @@ -399,7 +402,7 @@ module Configs Lang> { * This can be overridden to a smaller value to improve performance (a * value of 0 disables field flow), or a larger value to get more results. */ - default int fieldFlowBranchLimit() { result = 2 } + default int fieldFlowBranchLimit() { result = Lang::defaultFieldFlowBranchLimit() } /** Gets the access path limit. */ default int accessPathLimit() { result = Lang::accessPathLimit() } @@ -548,7 +551,7 @@ module Configs Lang> { * This can be overridden to a smaller value to improve performance (a * value of 0 disables field flow), or a larger value to get more results. */ - default int fieldFlowBranchLimit() { result = 2 } + default int fieldFlowBranchLimit() { result = Lang::defaultFieldFlowBranchLimit() } /** Gets the access path limit. */ default int accessPathLimit() { result = Lang::accessPathLimit() }