Skip to content

Commit

Permalink
C++: Make ql-for-ql happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasVP committed Nov 21, 2022
1 parent fcd9dd0 commit 7e80a57
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cpp/ql/src/Likely Bugs/OO/UnsafeUseOfThis.ql
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class UnsafeUseOfThisConfig extends MustFlowConfiguration {
override predicate isSink(Operand sink) { isSink(sink, _) }
}

/** Holds if `instr` is a `this` pointer used by the call instruction `call`. */
/** Holds if `sink` is a `this` pointer used by the call instruction `call`. */
predicate isSink(Operand sink, CallInstruction call) {
exists(PureVirtualFunction func |
call.getStaticCallTarget() = func and
Expand All @@ -37,7 +37,12 @@ predicate isSink(Operand sink, CallInstruction call) {
)
}

/** Holds if `init` initializes the `this` pointer in class `c`. */
/**
* Holds if `source` initializes the `this` pointer in class `c`.
*
* The string `msg` describes whether the enclosing function is a
* constructor or destructor.
*/
predicate isSource(InitializeParameterInstruction source, string msg, Class c) {
(
exists(Constructor func |
Expand Down

0 comments on commit 7e80a57

Please sign in to comment.