Skip to content

Commit 492c5f3

Browse files
committed
C++: Simplify NewDelete.qll.
1 parent 050e239 commit 492c5f3

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

cpp/ql/src/Critical/NewDelete.qll

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,9 @@ import semmle.code.cpp.models.implementations.Deallocation
1313
* a string describing the type of the allocation.
1414
*/
1515
predicate allocExpr(Expr alloc, string kind) {
16-
(
17-
alloc.(FunctionCall) instanceof AllocationExpr
18-
or
19-
alloc = any(NewOrNewArrayExpr new | not exists(new.getPlacementPointer()))
20-
) and
2116
(
2217
exists(Function target |
23-
alloc.(FunctionCall).getTarget() = target and
18+
alloc.(AllocationExpr).(FunctionCall).getTarget() = target and
2419
(
2520
target.getName() = "operator new" and
2621
kind = "new"

0 commit comments

Comments
 (0)