mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
C++: Simplify NewDelete.qll.
This commit is contained in:
@@ -13,14 +13,9 @@ import semmle.code.cpp.models.implementations.Deallocation
|
||||
* a string describing the type of the allocation.
|
||||
*/
|
||||
predicate allocExpr(Expr alloc, string kind) {
|
||||
(
|
||||
alloc.(FunctionCall) instanceof AllocationExpr
|
||||
or
|
||||
alloc = any(NewOrNewArrayExpr new | not exists(new.getPlacementPointer()))
|
||||
) and
|
||||
(
|
||||
exists(Function target |
|
||||
alloc.(FunctionCall).getTarget() = target and
|
||||
alloc.(AllocationExpr).(FunctionCall).getTarget() = target and
|
||||
(
|
||||
target.getName() = "operator new" and
|
||||
kind = "new"
|
||||
|
||||
Reference in New Issue
Block a user