Skip to content

Commit 50f2557

Browse files
authored
Merge pull request #5043 from MathiasVP/uniform-treatment-of-params-and-qualifiers-in-model-dataflow
C++: Uniform treatment of parameters and qualifiers in model dataflow
2 parents 7d9ebaf + 5a420f2 commit 50f2557

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -887,21 +887,15 @@ private predicate modelFlow(Operand opFrom, Instruction iTo) {
887887
iTo = call
888888
or
889889
exists(int index, WriteSideEffectInstruction outNode |
890-
modelOut.isParameterDeref(index) and
890+
modelOut.isParameterDerefOrQualifierObject(index) and
891891
iTo = outNode and
892892
outNode = getSideEffectFor(call, index)
893893
)
894-
or
895-
exists(WriteSideEffectInstruction outNode |
896-
modelOut.isQualifierObject() and
897-
iTo = outNode and
898-
outNode = getSideEffectFor(call, -1)
899-
)
900894
) and
901895
(
902896
exists(int index |
903-
modelIn.isParameter(index) and
904-
opFrom = call.getPositionalArgumentOperand(index)
897+
modelIn.isParameterOrQualifierAddress(index) and
898+
opFrom = call.getArgumentOperand(index)
905899
)
906900
or
907901
exists(int index, ReadSideEffectInstruction read |
@@ -910,9 +904,6 @@ private predicate modelFlow(Operand opFrom, Instruction iTo) {
910904
opFrom = read.getSideEffectOperand()
911905
)
912906
or
913-
modelIn.isQualifierAddress() and
914-
opFrom = call.getThisArgumentOperand()
915-
or
916907
exists(ReadSideEffectInstruction read |
917908
modelIn.isQualifierObject() and
918909
read = getSideEffectFor(call, -1) and

0 commit comments

Comments
 (0)