Skip to content

Commit 08fa611

Browse files
committed
C++: Avoid calling SwitchCase.getAStmt for performance reasons. This turns out to not be needed as the statements inside the switch case will get picked up by the BlockStmt.getAStmt case already.
1 parent 856d512 commit 08fa611

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-570/IncorrectAllocationErrorHandling.ql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ predicate stmtMayThrow(Stmt stmt) {
9898
stmtMayThrow(switchStmt.getStmt())
9999
)
100100
or
101-
stmtMayThrow(stmt.(SwitchCase).getAStmt())
102-
or
103101
// NOTE: We don't include `TryStmt` as those exceptions are not "observable" outside the function.
104102
stmtMayThrow(stmt.(Handler).getBlock())
105103
or

0 commit comments

Comments
 (0)