mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Merge pull request #19269 from jketema/non-second-level-limits
C++: Do not limit second level scopes to the top-level
This commit is contained in:
@@ -31,4 +31,6 @@ module CppDataFlow implements InputSig<Location> {
|
||||
predicate viableImplInCallContext = Private::viableImplInCallContext/2;
|
||||
|
||||
predicate neverSkipInPathGraph = Private::neverSkipInPathGraph/1;
|
||||
|
||||
int defaultFieldFlowBranchLimit() { result = 3 }
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user