Skip to content

Commit 4ddf121

Browse files
committed
C++: Don't suppress consistency checks for calls
See github#3162 (comment).
1 parent b03e87f commit 4ddf121

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,6 @@ predicate isImmutableOrUnobservable(Node n) {
311311
or
312312
dt.getBaseType() instanceof RoutineType
313313
)
314-
or
315-
// Isn't something we can track
316-
n.asExpr() instanceof Call
317314
// The above list of cases isn't exhaustive, but it narrows down the
318315
// consistency alerts enough that most of them are interesting.
319316
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ postIsInSameCallable
2323
reverseRead
2424
storeIsPostUpdate
2525
argHasPostUpdate
26+
| dispatch.cpp:77:21:77:34 | call to allocateBottom | ArgumentNode is missing PostUpdateNode. |
2627
| dispatch.cpp:78:23:78:39 | * ... | ArgumentNode is missing PostUpdateNode. |
2728
| lambdas.cpp:18:7:18:7 | a | ArgumentNode is missing PostUpdateNode. |
2829
| lambdas.cpp:25:2:25:2 | b | ArgumentNode is missing PostUpdateNode. |

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,27 @@ storeIsPostUpdate
4343
argHasPostUpdate
4444
| A.cpp:41:15:41:21 | new | ArgumentNode is missing PostUpdateNode. |
4545
| A.cpp:55:12:55:19 | new | ArgumentNode is missing PostUpdateNode. |
46+
| A.cpp:56:13:56:15 | call to get | ArgumentNode is missing PostUpdateNode. |
4647
| A.cpp:57:17:57:23 | new | ArgumentNode is missing PostUpdateNode. |
48+
| A.cpp:57:28:57:30 | call to get | ArgumentNode is missing PostUpdateNode. |
4749
| A.cpp:64:21:64:28 | new | ArgumentNode is missing PostUpdateNode. |
4850
| A.cpp:73:25:73:32 | new | ArgumentNode is missing PostUpdateNode. |
4951
| A.cpp:126:12:126:18 | new | ArgumentNode is missing PostUpdateNode. |
5052
| A.cpp:160:32:160:59 | new | ArgumentNode is missing PostUpdateNode. |
53+
| D.cpp:22:25:22:31 | call to getElem | ArgumentNode is missing PostUpdateNode. |
5154
| D.cpp:29:24:29:40 | new | ArgumentNode is missing PostUpdateNode. |
5255
| D.cpp:36:24:36:40 | new | ArgumentNode is missing PostUpdateNode. |
5356
| D.cpp:43:24:43:40 | new | ArgumentNode is missing PostUpdateNode. |
5457
| D.cpp:50:24:50:40 | new | ArgumentNode is missing PostUpdateNode. |
5558
| D.cpp:57:25:57:41 | new | ArgumentNode is missing PostUpdateNode. |
59+
| by_reference.cpp:50:17:50:26 | call to user_input | ArgumentNode is missing PostUpdateNode. |
5660
| by_reference.cpp:51:8:51:8 | s | ArgumentNode is missing PostUpdateNode. |
61+
| by_reference.cpp:51:10:51:20 | call to getDirectly | ArgumentNode is missing PostUpdateNode. |
62+
| by_reference.cpp:56:19:56:28 | call to user_input | ArgumentNode is missing PostUpdateNode. |
5763
| by_reference.cpp:57:8:57:8 | s | ArgumentNode is missing PostUpdateNode. |
64+
| by_reference.cpp:57:10:57:22 | call to getIndirectly | ArgumentNode is missing PostUpdateNode. |
65+
| by_reference.cpp:62:25:62:34 | call to user_input | ArgumentNode is missing PostUpdateNode. |
5866
| by_reference.cpp:63:8:63:8 | s | ArgumentNode is missing PostUpdateNode. |
67+
| by_reference.cpp:63:10:63:28 | call to getThroughNonMember | ArgumentNode is missing PostUpdateNode. |
68+
| by_reference.cpp:68:21:68:30 | call to user_input | ArgumentNode is missing PostUpdateNode. |
69+
| by_reference.cpp:69:8:69:20 | call to nonMemberGetA | ArgumentNode is missing PostUpdateNode. |

cpp/ql/test/library-tests/syntax-zoo/dataflow-consistency.expected

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ reverseRead
9292
storeIsPostUpdate
9393
argHasPostUpdate
9494
| builtin.cpp:15:31:15:35 | * ... | ArgumentNode is missing PostUpdateNode. |
95+
| conditional_destructors.cpp:30:9:30:13 | call to C1 | ArgumentNode is missing PostUpdateNode. |
96+
| conditional_destructors.cpp:33:9:33:13 | call to C1 | ArgumentNode is missing PostUpdateNode. |
97+
| conditional_destructors.cpp:39:9:39:13 | call to C2 | ArgumentNode is missing PostUpdateNode. |
98+
| conditional_destructors.cpp:42:9:42:13 | call to C2 | ArgumentNode is missing PostUpdateNode. |
9599
| cpp11.cpp:77:5:77:17 | unaryFunction | ArgumentNode is missing PostUpdateNode. |
96100
| destructors.cpp:52:14:52:16 | ref | ArgumentNode is missing PostUpdateNode. |
97101
| ir.cpp:623:5:623:5 | r | ArgumentNode is missing PostUpdateNode. |

0 commit comments

Comments
 (0)