C++: Deprecate freeCall in the legacy wrapper Alloc.qll.

This commit is contained in:
Geoffrey White
2020-04-06 14:32:49 +01:00
parent e223557201
commit cbe133d0e6
2 changed files with 3 additions and 1 deletions

View File

@@ -4,7 +4,7 @@ private predicate freed(Expr e) {
e = any(DeallocationExpr de).getFreedExpr() e = any(DeallocationExpr de).getFreedExpr()
or or
exists(ExprCall c | exists(ExprCall c |
// cautiously assume that any ExprCall could be a freeCall. // cautiously assume that any `ExprCall` could be a deallocation expression.
c.getAnArgument() = e c.getAnArgument() = e
) )
} }

View File

@@ -23,6 +23,8 @@ predicate freeFunction(Function f, int argNum) { argNum = f.(DeallocationFunctio
/** /**
* A call to a library routine that frees memory. * A call to a library routine that frees memory.
*
* DEPRECATED: Use `DeallocationExpr` instead (this also includes `delete` expressions).
*/ */
predicate freeCall(FunctionCall fc, Expr arg) { arg = fc.(DeallocationExpr).getFreedExpr() } predicate freeCall(FunctionCall fc, Expr arg) { arg = fc.(DeallocationExpr).getFreedExpr() }