Skip to content

Commit 23b9db8

Browse files
authored
Merge pull request #19904 from jketema/ffbl
C++: Sync the product-flow field flow branch limits with the default one
2 parents 3d73432 + 3e31cd3 commit 23b9db8

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/ProductFlow.qll

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import semmle.code.cpp.dataflow.new.DataFlow
1616
private import DataFlowPrivate
1717
private import DataFlowUtil
1818
private import DataFlowImplCommon
19+
private import DataFlowImplSpecific
1920
private import codeql.util.Unit
2021

2122
/**
@@ -95,10 +96,7 @@ module ProductFlow {
9596
* This can be overridden to a smaller value to improve performance (a
9697
* value of 0 disables field flow), or a larger value to get more results.
9798
*/
98-
default int fieldFlowBranchLimit1() {
99-
// NOTE: This should be synchronized with the default value in the shared dataflow library
100-
result = 2
101-
}
99+
default int fieldFlowBranchLimit1() { result = CppDataFlow::defaultFieldFlowBranchLimit() }
102100

103101
/**
104102
* Gets the virtual dispatch branching limit when calculating field flow in the second
@@ -107,10 +105,7 @@ module ProductFlow {
107105
* This can be overridden to a smaller value to improve performance (a
108106
* value of 0 disables field flow), or a larger value to get more results.
109107
*/
110-
default int fieldFlowBranchLimit2() {
111-
// NOTE: This should be synchronized with the default value in the shared dataflow library
112-
result = 2
113-
}
108+
default int fieldFlowBranchLimit2() { result = CppDataFlow::defaultFieldFlowBranchLimit() }
114109
}
115110

116111
/**
@@ -304,10 +299,7 @@ module ProductFlow {
304299
* This can be overridden to a smaller value to improve performance (a
305300
* value of 0 disables field flow), or a larger value to get more results.
306301
*/
307-
default int fieldFlowBranchLimit1() {
308-
// NOTE: This should be synchronized with the default value in the shared dataflow library
309-
result = 2
310-
}
302+
default int fieldFlowBranchLimit1() { result = CppDataFlow::defaultFieldFlowBranchLimit() }
311303

312304
/**
313305
* Gets the virtual dispatch branching limit when calculating field flow in the second
@@ -316,10 +308,7 @@ module ProductFlow {
316308
* This can be overridden to a smaller value to improve performance (a
317309
* value of 0 disables field flow), or a larger value to get more results.
318310
*/
319-
default int fieldFlowBranchLimit2() {
320-
// NOTE: This should be synchronized with the default value in the shared dataflow library
321-
result = 2
322-
}
311+
default int fieldFlowBranchLimit2() { result = CppDataFlow::defaultFieldFlowBranchLimit() }
323312
}
324313

325314
/**

0 commit comments

Comments
 (0)