Skip to content

Commit 2abf4c0

Browse files
committed
C++: Use getAnExpr. Also extend the other recursive case similarly.
1 parent 834e35f commit 2abf4c0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,11 @@ private predicate exprReleases(Expr e, Expr released, string kind) {
9999
e.(FunctionCall).getTarget().(MemberFunction).getAnOverridingFunction+() = f
100100
) and
101101
e.(FunctionCall).getArgument(arg) = released and
102-
exprReleases(_, exprOrDereference(f.getParameter(arg).getAnAccess()), kind)
102+
exprReleases(_,
103+
exprOrDereference(globalValueNumber(f.getParameter(arg).getAnAccess()).getAnExpr()), kind)
103104
)
104105
or
105-
exists(Function f, ThisExpr innerThis, Expr likeInnerThis |
106+
exists(Function f, ThisExpr innerThis |
106107
// `e` is a call to a method that releases `this`, and `released`
107108
// is the object that is called
108109
(
@@ -111,8 +112,7 @@ private predicate exprReleases(Expr e, Expr released, string kind) {
111112
) and
112113
e.(FunctionCall).getQualifier() = exprOrDereference(released) and
113114
innerThis.getEnclosingFunction() = f and
114-
globalValueNumber(innerThis) = globalValueNumber(likeInnerThis) and
115-
exprReleases(_, likeInnerThis, kind)
115+
exprReleases(_, globalValueNumber(innerThis).getAnExpr(), kind)
116116
)
117117
}
118118

0 commit comments

Comments
 (0)