Skip to content

Commit 856d512

Browse files
committed
C++: Simplify noThrowInTryBlock.
1 parent 7c1720a commit 856d512

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,7 @@ class BadAllocCatchBlock extends CatchBlock {
182182
*/
183183
predicate noThrowInTryBlock(NewOrNewArrayExpr newExpr, BadAllocCatchBlock catchBlock) {
184184
exists(TryStmt try |
185-
forall(Expr cand | cand.getEnclosingBlock().getEnclosingBlock*() = try.getStmt() |
186-
not convertedExprMayThrow(cand)
187-
) and
185+
not stmtMayThrow(try.getStmt()) and
188186
try.getACatchClause() = catchBlock and
189187
newExpr.getEnclosingBlock().getEnclosingBlock*() = try.getStmt()
190188
)

0 commit comments

Comments
 (0)