Skip to content

Commit c325a79

Browse files
committed
C++: Ensure 'isConditionalTemporaryDestructorCall' only holds when the reused expression is a temporary.
1 parent 17c8fa3 commit c325a79

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ private predicate isInConditionalEvaluation(Expr e) {
287287
}
288288

289289
private predicate isConditionalTemporaryDestructorCall(DestructorCall dc) {
290-
isInConditionalEvaluation(dc.getQualifier().(ReuseExpr).getReusedExpr())
290+
exists(TemporaryObjectExpr temp |
291+
temp = dc.getQualifier().(ReuseExpr).getReusedExpr() and
292+
isInConditionalEvaluation(temp)
293+
)
291294
}
292295

293296
/**

0 commit comments

Comments
 (0)