mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
CPP: Replace call to getEnclosingAccessHolder() with getEnclosingElement().
This commit is contained in:
@@ -191,9 +191,7 @@ predicate freedInSameMethod(Resource r, Expr acquire) {
|
||||
exists(Expr releaseExpr, string kind |
|
||||
r.acquisitionWithRequiredKind(acquire, kind) and
|
||||
releaseExpr = r.getAReleaseExpr(kind) and
|
||||
releaseExpr.getEnclosingFunction().getEnclosingAccessHolder*() = acquire.getEnclosingFunction()
|
||||
// here, `getEnclosingAccessHolder*` allows us to go from a nested function or lambda
|
||||
// expression to the class method enclosing it.
|
||||
releaseExpr.getEnclosingElement*() = acquire.getEnclosingFunction()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user