Skip to content

Commit 31c2a3b

Browse files
committed
C++: Don't redefine the meaning of the single-parameter 'isParameterDeref' and accept test changes.
1 parent ff30308 commit 31c2a3b

File tree

3 files changed

+1
-11
lines changed

3 files changed

+1
-11
lines changed

cpp/ql/lib/semmle/code/cpp/models/interfaces/FunctionInputsAndOutputs.qll

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,6 @@ class InParameterDeref extends FunctionInput, TInParameterDeref {
254254
/** Gets the zero-based index of the parameter. */
255255
ParameterIndex getIndex() { result = index }
256256

257-
override predicate isParameterDeref(ParameterIndex i) { index = i }
258-
259257
override predicate isParameterDeref(ParameterIndex i, int indirection) {
260258
i = index and indirectionIndex = indirection
261259
}
@@ -511,10 +509,8 @@ class OutParameterDeref extends FunctionOutput, TOutParameterDeref {
511509

512510
ParameterIndex getIndex() { result = index }
513511

514-
override predicate isParameterDeref(ParameterIndex i) { i = index }
515-
516512
override predicate isParameterDeref(ParameterIndex i, int ind) {
517-
this.isParameterDeref(i) and ind = indirectionIndex
513+
i = index and ind = indirectionIndex
518514
}
519515
}
520516

cpp/ql/test/library-tests/dataflow/dataflow-tests/dataflow-ir-consistency.expected

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,8 @@ reverseRead
2020
argHasPostUpdate
2121
postWithInFlow
2222
| test.cpp:384:10:384:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
23-
| test.cpp:384:10:384:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
24-
| test.cpp:391:10:391:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
2523
| test.cpp:391:10:391:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
2624
| test.cpp:400:10:400:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
27-
| test.cpp:400:10:400:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
28-
| test.cpp:407:10:407:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
2925
| test.cpp:407:10:407:13 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
3026
viableImplInCallContextTooLarge
3127
uniqueParameterNodeAtPosition

cpp/ql/test/library-tests/dataflow/fields/dataflow-ir-consistency.expected

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ reverseRead
4444
argHasPostUpdate
4545
postWithInFlow
4646
| realistic.cpp:54:16:54:47 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
47-
| realistic.cpp:54:16:54:47 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
48-
| realistic.cpp:60:16:60:18 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
4947
| realistic.cpp:60:16:60:18 | memcpy output argument | PostUpdateNode should not be the target of local flow. |
5048
viableImplInCallContextTooLarge
5149
uniqueParameterNodeAtPosition

0 commit comments

Comments
 (0)