Skip to content

Commit b3d18ef

Browse files
committed
C++: Add cases for conditional and comma operator in AV RUle 82
1 parent eea8934 commit b3d18ef

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ predicate dereferenceThis(Expr e) {
4545
or
4646
// `*this = ...` (where `=` is not overloaded, so an `AssignExpr`)
4747
dereferenceThis(e.(AssignExpr).getLValue())
48+
or
49+
// `e ? ... : ... `
50+
exists(ConditionalExpr cond |
51+
cond = e and
52+
dereferenceThis(cond.getThen()) and
53+
dereferenceThis(cond.getElse())
54+
)
55+
or
56+
// `..., ... `
57+
dereferenceThis(e.(CommaExpr).getRightOperand())
4858
}
4959

5060
/**

0 commit comments

Comments
 (0)