mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Merge pull request #4218 from MathiasVP/mathiasvp/fix-fp-av82
C++: Add cases for conditional and comma operator in AV Rule 82
This commit is contained in:
@@ -45,6 +45,16 @@ predicate dereferenceThis(Expr e) {
|
||||
or
|
||||
// `*this = ...` (where `=` is not overloaded, so an `AssignExpr`)
|
||||
dereferenceThis(e.(AssignExpr).getLValue())
|
||||
or
|
||||
// `e ? ... : ... `
|
||||
exists(ConditionalExpr cond |
|
||||
cond = e and
|
||||
dereferenceThis(cond.getThen()) and
|
||||
dereferenceThis(cond.getElse())
|
||||
)
|
||||
or
|
||||
// `..., ... `
|
||||
dereferenceThis(e.(CommaExpr).getRightOperand())
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user