diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll index c5024d07dcb4..39975d8883c4 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll @@ -1652,8 +1652,6 @@ predicate validParameterAliasStep(Node node1, Node node2) { ) } -private predicate isTopLevel(Cpp::Stmt s) { any(Function f).getBlock().getAStmt() = s } - private Cpp::Stmt getAChainedBranch(Cpp::IfStmt s) { result = s.getThen() or @@ -1684,11 +1682,9 @@ private Instruction getAnInstruction(Node n) { } private newtype TDataFlowSecondLevelScope = - TTopLevelIfBranch(Cpp::Stmt s) { - exists(Cpp::IfStmt ifstmt | s = getAChainedBranch(ifstmt) and isTopLevel(ifstmt)) - } or + TTopLevelIfBranch(Cpp::Stmt s) { s = getAChainedBranch(_) } or TTopLevelSwitchCase(Cpp::SwitchCase s) { - exists(Cpp::SwitchStmt switchstmt | s = switchstmt.getASwitchCase() and isTopLevel(switchstmt)) + exists(Cpp::SwitchStmt switchstmt | s = switchstmt.getASwitchCase()) } /** diff --git a/shared/dataflow/codeql/dataflow/DataFlow.qll b/shared/dataflow/codeql/dataflow/DataFlow.qll index 0d78d13c8848..ca56f733e9af 100644 --- a/shared/dataflow/codeql/dataflow/DataFlow.qll +++ b/shared/dataflow/codeql/dataflow/DataFlow.qll @@ -399,7 +399,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 = 3 } /** Gets the access path limit. */ default int accessPathLimit() { result = Lang::accessPathLimit() } @@ -548,7 +548,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 = 3 } /** Gets the access path limit. */ default int accessPathLimit() { result = Lang::accessPathLimit() }