Skip to content

Commit d279e3f

Browse files
committed
C++: Suppress destructor calls for the right-hand side of logical operations since these are also conditional.
1 parent e63a607 commit d279e3f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ private predicate isInConditionalEvaluation(Expr e) {
279279
e = cond.getFullyConverted()
280280
)
281281
or
282+
e = any(LogicalAndExpr lae).getRightOperand().getFullyConverted()
283+
or
284+
e = any(LogicalOrExpr loe).getRightOperand().getFullyConverted()
285+
or
282286
isInConditionalEvaluation(getRealParent(e))
283287
}
284288

0 commit comments

Comments
 (0)