Skip to content

Commit 79c713b

Browse files
committed
C++: Remark in DefinitionByReference charpred
1 parent 114c2fe commit 79c713b

File tree

1 file changed

+7
-1
lines changed
  • cpp/ql/src/semmle/code/cpp/dataflow/internal

1 file changed

+7
-1
lines changed

cpp/ql/src/semmle/code/cpp/dataflow/internal/FlowVar.qll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,13 @@ private module PartialDefinitions {
159159
class DefinitionByReference extends PartialDefinition, TReferenceArgument {
160160
VariableAccess va;
161161

162-
DefinitionByReference() { referenceArgument(va, definedExpr) }
162+
DefinitionByReference() {
163+
// `this` is not restricted in this charpred. That's because the full
164+
// extent of this class includes the charpred of the superclass, which
165+
// relates `this` to `definedExpr`, and `va` is functionally determined
166+
// by `definedExpr`.
167+
referenceArgument(va, definedExpr)
168+
}
163169

164170
VariableAccess getVariableAccess() { result = va }
165171

0 commit comments

Comments
 (0)