Skip to content

Commit 6ece3c2

Browse files
authored
Merge pull request #6870 from jbj/cp-fixes
C++: Fix potential Cartesian products
2 parents d4fd878 + e80c1ad commit 6ece3c2

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ class VarAnalyzableExpr extends AnalyzableExpr, VariableAccess {
166166
* Holds if `t` is not an instance of `IntegralType`,
167167
* or if `me` cannot be proven to not overflow
168168
*/
169+
pragma[inline]
169170
predicate overflows(MulExpr me, Type t) {
170171
t instanceof IntegralType
171172
implies

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,13 @@ predicate leakedInSameMethod(Resource r, Expr acquire) {
230230
)
231231
)
232232
)
233-
or
234-
exists(FunctionAccess fa, string kind |
235-
// the address of a function that releases `r` is taken (and likely
236-
// used to release `r` at some point).
237-
r.acquisitionWithRequiredKind(acquire, kind) and
238-
fa.getTarget() = r.getAReleaseExpr(kind).getEnclosingFunction()
239-
)
233+
)
234+
or
235+
exists(FunctionAccess fa, string kind |
236+
// the address of a function that releases `r` is taken (and likely
237+
// used to release `r` at some point).
238+
r.acquisitionWithRequiredKind(acquire, kind) and
239+
fa.getTarget() = r.getAReleaseExpr(kind).getEnclosingFunction()
240240
)
241241
}
242242

0 commit comments

Comments
 (0)