Skip to content

Commit a649b18

Browse files
committed
C#: Remove hasNotNullFlowState and hasMaybeNullFlowState
1 parent f2380d3 commit a649b18

File tree

6 files changed

+0
-328
lines changed

6 files changed

+0
-328
lines changed

csharp/ql/lib/semmle/code/csharp/controlflow/Guards.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,8 +1186,6 @@ module Internal {
11861186
or
11871187
e instanceof ArrayCreation
11881188
or
1189-
e.hasNotNullFlowState()
1190-
or
11911189
e.hasValue() and
11921190
exists(Expr stripped | stripped = e.stripCasts() |
11931191
not stripped instanceof NullLiteral and

csharp/ql/lib/semmle/code/csharp/exprs/Expr.qll

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,6 @@ class Expr extends ControlFlowElement, @expr {
108108
* that uses the result of this expression.
109109
*/
110110
override Element getParent() { result = ControlFlowElement.super.getParent() }
111-
112-
/** Holds if the nullable flow state of this expression is not null. */
113-
predicate hasNotNullFlowState() { expr_flowstate(this, 1) }
114-
115-
/** Holds if the nullable flow state of this expression may be null. */
116-
predicate hasMaybeNullFlowState() { expr_flowstate(this, 2) }
117111
}
118112

119113
/**

csharp/ql/test/library-tests/controlflow/guards/AbstractValue.expected

Lines changed: 0 additions & 208 deletions
Original file line numberDiff line numberDiff line change
@@ -91,285 +91,77 @@ abstractValue
9191
| non-empty | Collections.cs:88:26:88:32 | { ..., ... } |
9292
| non-empty | Collections.cs:89:22:89:28 | { ..., ... } |
9393
| non-null | Assert.cs:9:31:9:32 | "" |
94-
| non-null | Assert.cs:10:9:10:13 | access to type Debug |
95-
| non-null | Assert.cs:11:9:11:15 | access to type Console |
96-
| non-null | Assert.cs:11:27:11:27 | access to local variable s |
9794
| non-null | Assert.cs:16:31:16:32 | "" |
98-
| non-null | Assert.cs:17:9:17:14 | access to type Assert |
99-
| non-null | Assert.cs:18:9:18:15 | access to type Console |
10095
| non-null | Assert.cs:23:31:23:32 | "" |
101-
| non-null | Assert.cs:24:9:24:14 | access to type Assert |
102-
| non-null | Assert.cs:25:9:25:15 | access to type Console |
10396
| non-null | Assert.cs:30:31:30:32 | "" |
104-
| non-null | Assert.cs:31:9:31:14 | access to type Assert |
105-
| non-null | Assert.cs:32:9:32:15 | access to type Console |
10697
| non-null | Assert.cs:37:31:37:32 | "" |
107-
| non-null | Assert.cs:38:9:38:14 | access to type Assert |
108-
| non-null | Assert.cs:39:9:39:15 | access to type Console |
10998
| non-null | Assert.cs:44:31:44:32 | "" |
110-
| non-null | Assert.cs:45:9:45:14 | access to type Assert |
111-
| non-null | Assert.cs:46:9:46:15 | access to type Console |
11299
| non-null | Assert.cs:51:31:51:32 | "" |
113-
| non-null | Assert.cs:52:9:52:14 | access to type Assert |
114-
| non-null | Assert.cs:53:9:53:15 | access to type Console |
115100
| non-null | Assert.cs:58:31:58:32 | "" |
116-
| non-null | Assert.cs:59:9:59:14 | access to type Assert |
117-
| non-null | Assert.cs:60:9:60:15 | access to type Console |
118101
| non-null | Assert.cs:65:31:65:32 | "" |
119-
| non-null | Assert.cs:66:9:66:14 | access to type Assert |
120-
| non-null | Assert.cs:67:9:67:15 | access to type Console |
121102
| non-null | Assert.cs:72:31:72:32 | "" |
122-
| non-null | Assert.cs:73:9:73:14 | access to type Assert |
123-
| non-null | Assert.cs:74:9:74:15 | access to type Console |
124103
| non-null | Assert.cs:79:31:79:32 | "" |
125-
| non-null | Assert.cs:80:9:80:14 | access to type Assert |
126-
| non-null | Assert.cs:81:9:81:15 | access to type Console |
127104
| non-null | Assert.cs:93:9:93:35 | this access |
128-
| non-null | Collections.cs:11:17:11:20 | access to parameter args |
129-
| non-null | Collections.cs:12:13:12:16 | access to parameter args |
130-
| non-null | Collections.cs:13:13:13:16 | access to parameter args |
131-
| non-null | Collections.cs:14:13:14:16 | access to parameter args |
132-
| non-null | Collections.cs:15:13:15:16 | access to parameter args |
133-
| non-null | Collections.cs:16:13:16:16 | access to parameter args |
134-
| non-null | Collections.cs:17:13:17:16 | access to parameter args |
135-
| non-null | Collections.cs:22:17:22:20 | access to parameter args |
136-
| non-null | Collections.cs:23:13:23:16 | access to parameter args |
137-
| non-null | Collections.cs:24:13:24:16 | access to parameter args |
138-
| non-null | Collections.cs:25:13:25:16 | access to parameter args |
139-
| non-null | Collections.cs:26:13:26:16 | access to parameter args |
140-
| non-null | Collections.cs:27:13:27:16 | access to parameter args |
141-
| non-null | Collections.cs:28:13:28:16 | access to parameter args |
142-
| non-null | Collections.cs:33:17:33:20 | access to parameter args |
143-
| non-null | Collections.cs:34:13:34:16 | access to parameter args |
144-
| non-null | Collections.cs:35:13:35:16 | access to parameter args |
145-
| non-null | Collections.cs:36:13:36:16 | access to parameter args |
146-
| non-null | Collections.cs:37:13:37:16 | access to parameter args |
147-
| non-null | Collections.cs:38:13:38:16 | access to parameter args |
148-
| non-null | Collections.cs:39:13:39:16 | access to parameter args |
149-
| non-null | Collections.cs:44:17:44:20 | access to parameter args |
150-
| non-null | Collections.cs:49:13:49:16 | access to parameter args |
151-
| non-null | Collections.cs:51:17:51:20 | access to parameter args |
152-
| non-null | Collections.cs:51:17:51:30 | call to method ToArray |
153-
| non-null | Collections.cs:52:9:52:12 | access to parameter args |
154-
| non-null | Collections.cs:53:9:53:9 | access to local variable x |
155-
| non-null | Collections.cs:53:9:53:26 | ... = ... |
156-
| non-null | Collections.cs:53:13:53:16 | access to parameter args |
157-
| non-null | Collections.cs:53:13:53:26 | call to method ToArray |
158-
| non-null | Collections.cs:54:9:54:9 | access to local variable x |
159105
| non-null | Collections.cs:54:9:54:42 | ... = ... |
160106
| non-null | Collections.cs:54:13:54:42 | array creation of type String[] |
161107
| non-null | Collections.cs:54:28:54:30 | "a" |
162108
| non-null | Collections.cs:54:33:54:35 | "b" |
163109
| non-null | Collections.cs:54:38:54:40 | "c" |
164-
| non-null | Collections.cs:55:9:55:9 | access to local variable x |
165110
| non-null | Collections.cs:55:9:55:13 | ... = ... |
166111
| non-null | Collections.cs:55:13:55:13 | access to local variable x |
167-
| non-null | Collections.cs:56:9:56:9 | access to local variable x |
168112
| non-null | Collections.cs:56:9:56:25 | ... = ... |
169113
| non-null | Collections.cs:56:13:56:25 | array creation of type String[] |
170-
| non-null | Collections.cs:57:9:57:9 | access to local variable x |
171114
| non-null | Collections.cs:57:9:57:13 | ... = ... |
172115
| non-null | Collections.cs:57:13:57:13 | access to local variable x |
173116
| non-null | Collections.cs:62:17:62:46 | array creation of type String[] |
174-
| non-null | Collections.cs:62:17:62:55 | call to method ToList<String> |
175117
| non-null | Collections.cs:62:32:62:34 | "a" |
176118
| non-null | Collections.cs:62:37:62:39 | "b" |
177119
| non-null | Collections.cs:62:42:62:44 | "c" |
178-
| non-null | Collections.cs:63:9:63:9 | access to local variable x |
179-
| non-null | Collections.cs:64:13:64:13 | access to local variable x |
180-
| non-null | Collections.cs:66:13:66:13 | access to local variable x |
181120
| non-null | Collections.cs:66:19:66:21 | "a" |
182-
| non-null | Collections.cs:67:13:67:13 | access to local variable x |
183121
| non-null | Collections.cs:67:19:67:21 | "b" |
184-
| non-null | Collections.cs:73:35:73:35 | access to parameter s |
185122
| non-null | Collections.cs:73:40:73:41 | "" |
186-
| non-null | Collections.cs:74:17:74:20 | access to parameter args |
187-
| non-null | Collections.cs:74:26:74:32 | access to local function IsEmpty |
188-
| non-null | Collections.cs:74:26:74:32 | delegate creation of type Func<String,Boolean> |
189123
| non-null | Collections.cs:74:26:74:32 | this access |
190-
| non-null | Collections.cs:75:13:75:16 | access to parameter args |
191-
| non-null | Collections.cs:75:24:75:30 | access to local function IsEmpty |
192-
| non-null | Collections.cs:75:24:75:30 | delegate creation of type Func<String,Boolean> |
193124
| non-null | Collections.cs:75:24:75:30 | this access |
194-
| non-null | Collections.cs:76:13:76:16 | access to parameter args |
195-
| non-null | Collections.cs:76:24:76:30 | access to local function IsEmpty |
196-
| non-null | Collections.cs:76:24:76:30 | delegate creation of type Func<String,Boolean> |
197125
| non-null | Collections.cs:76:24:76:30 | this access |
198-
| non-null | Collections.cs:77:13:77:16 | access to parameter args |
199-
| non-null | Collections.cs:77:24:77:30 | access to local function IsEmpty |
200-
| non-null | Collections.cs:77:24:77:30 | delegate creation of type Func<String,Boolean> |
201126
| non-null | Collections.cs:77:24:77:30 | this access |
202-
| non-null | Collections.cs:78:13:78:16 | access to parameter args |
203-
| non-null | Collections.cs:78:24:78:30 | access to local function IsEmpty |
204-
| non-null | Collections.cs:78:24:78:30 | delegate creation of type Func<String,Boolean> |
205127
| non-null | Collections.cs:78:24:78:30 | this access |
206-
| non-null | Collections.cs:79:13:79:16 | access to parameter args |
207-
| non-null | Collections.cs:79:24:79:30 | access to local function IsEmpty |
208-
| non-null | Collections.cs:79:24:79:30 | delegate creation of type Func<String,Boolean> |
209128
| non-null | Collections.cs:79:24:79:30 | this access |
210-
| non-null | Collections.cs:80:13:80:16 | access to parameter args |
211-
| non-null | Collections.cs:80:24:80:30 | access to local function IsEmpty |
212-
| non-null | Collections.cs:80:24:80:30 | delegate creation of type Func<String,Boolean> |
213129
| non-null | Collections.cs:80:24:80:30 | this access |
214-
| non-null | Collections.cs:81:13:81:16 | access to parameter args |
215-
| non-null | Collections.cs:81:24:81:30 | access to local function IsEmpty |
216-
| non-null | Collections.cs:81:24:81:30 | delegate creation of type Func<String,Boolean> |
217130
| non-null | Collections.cs:81:24:81:30 | this access |
218131
| non-null | Collections.cs:86:17:86:32 | array creation of type String[] |
219132
| non-null | Collections.cs:87:22:87:24 | array creation of type String[] |
220-
| non-null | Collections.cs:88:9:88:9 | access to local variable x |
221133
| non-null | Collections.cs:88:9:88:32 | ... = ... |
222134
| non-null | Collections.cs:88:13:88:32 | array creation of type String[] |
223135
| non-null | Collections.cs:88:28:88:30 | "a" |
224136
| non-null | Collections.cs:89:22:89:28 | array creation of type String[] |
225137
| non-null | Collections.cs:89:24:89:26 | "a" |
226-
| non-null | Collections.cs:94:29:94:32 | access to parameter args |
227-
| non-null | Collections.cs:95:13:95:19 | access to type Console |
228-
| non-null | Collections.cs:95:31:95:34 | access to parameter args |
229-
| non-null | Collections.cs:100:29:100:32 | access to parameter args |
230-
| non-null | Collections.cs:102:9:102:15 | access to type Console |
231-
| non-null | Collections.cs:102:27:102:30 | access to parameter args |
232-
| non-null | Guards.cs:12:13:12:13 | access to parameter s |
233-
| non-null | Guards.cs:14:13:14:19 | access to type Console |
234-
| non-null | Guards.cs:14:31:14:31 | access to parameter s |
235-
| non-null | Guards.cs:18:13:18:19 | access to type Console |
236138
| non-null | Guards.cs:18:31:18:46 | "<empty string>" |
237-
| non-null | Guards.cs:26:13:26:19 | access to type Console |
238-
| non-null | Guards.cs:26:31:26:31 | access to parameter s |
239-
| non-null | Guards.cs:32:14:32:19 | access to type String |
240-
| non-null | Guards.cs:33:13:33:19 | access to type Console |
241139
| non-null | Guards.cs:33:31:33:35 | ... + ... |
242-
| non-null | Guards.cs:36:14:36:20 | access to type Console |
243-
| non-null | Guards.cs:36:32:36:32 | access to parameter x |
244140
| non-null | Guards.cs:36:32:36:36 | ... + ... |
245-
| non-null | Guards.cs:36:36:36:36 | access to parameter y |
246-
| non-null | Guards.cs:39:13:39:19 | access to type Console |
247-
| non-null | Guards.cs:39:31:39:31 | access to parameter x |
248141
| non-null | Guards.cs:39:31:39:35 | ... + ... |
249-
| non-null | Guards.cs:39:35:39:35 | access to parameter y |
250-
| non-null | Guards.cs:42:14:42:20 | access to type Console |
251-
| non-null | Guards.cs:42:32:42:32 | access to parameter x |
252142
| non-null | Guards.cs:42:32:42:36 | ... + ... |
253-
| non-null | Guards.cs:42:36:42:36 | access to parameter y |
254143
| non-null | Guards.cs:44:13:44:17 | this access |
255-
| non-null | Guards.cs:45:13:45:19 | access to type Console |
256144
| non-null | Guards.cs:45:31:45:42 | object creation of type Guards |
257145
| non-null | Guards.cs:47:13:47:17 | this access |
258-
| non-null | Guards.cs:48:13:48:19 | access to type Console |
259146
| non-null | Guards.cs:48:31:48:34 | this access |
260-
| non-null | Guards.cs:48:31:48:40 | access to field Field |
261-
| non-null | Guards.cs:53:13:53:13 | access to parameter g |
262-
| non-null | Guards.cs:55:9:55:15 | access to type Console |
263-
| non-null | Guards.cs:55:27:55:27 | access to parameter g |
264-
| non-null | Guards.cs:55:27:55:33 | access to field Field |
265-
| non-null | Guards.cs:60:13:60:13 | access to parameter g |
266147
| non-null | Guards.cs:61:19:61:33 | object creation of type Exception |
267-
| non-null | Guards.cs:62:9:62:15 | access to type Console |
268-
| non-null | Guards.cs:62:27:62:27 | access to parameter g |
269-
| non-null | Guards.cs:62:27:62:36 | access to property Property |
270-
| non-null | Guards.cs:62:27:62:45 | access to property Property |
271-
| non-null | Guards.cs:62:27:62:51 | access to field Field |
272-
| non-null | Guards.cs:63:9:63:15 | access to type Console |
273-
| non-null | Guards.cs:63:27:63:27 | access to parameter g |
274-
| non-null | Guards.cs:63:27:63:36 | access to property Property |
275-
| non-null | Guards.cs:70:13:70:19 | access to type Console |
276-
| non-null | Guards.cs:70:31:70:31 | access to parameter s |
277-
| non-null | Guards.cs:71:13:71:13 | access to parameter s |
278-
| non-null | Guards.cs:72:13:72:19 | access to type Console |
279148
| non-null | Guards.cs:78:26:78:26 | (...) ... |
280-
| non-null | Guards.cs:79:13:79:19 | access to type Console |
281-
| non-null | Guards.cs:79:31:79:31 | access to parameter s |
282149
| non-null | Guards.cs:80:25:80:25 | (...) ... |
283-
| non-null | Guards.cs:81:13:81:19 | access to type Console |
284-
| non-null | Guards.cs:81:31:81:31 | access to parameter s |
285150
| non-null | Guards.cs:82:26:82:26 | (...) ... |
286-
| non-null | Guards.cs:83:13:83:19 | access to type Console |
287-
| non-null | Guards.cs:83:31:83:31 | access to parameter s |
288151
| non-null | Guards.cs:84:25:84:26 | (...) ... |
289-
| non-null | Guards.cs:85:13:85:19 | access to type Console |
290-
| non-null | Guards.cs:85:31:85:31 | access to parameter s |
291152
| non-null | Guards.cs:86:26:86:27 | (...) ... |
292-
| non-null | Guards.cs:87:13:87:19 | access to type Console |
293-
| non-null | Guards.cs:87:31:87:31 | access to parameter s |
294-
| non-null | Guards.cs:89:13:89:19 | access to type Console |
295-
| non-null | Guards.cs:89:31:89:31 | access to parameter s |
296-
| non-null | Guards.cs:91:13:91:19 | access to type Console |
297153
| non-null | Guards.cs:92:25:92:25 | (...) ... |
298154
| non-null | Guards.cs:92:30:92:30 | (...) ... |
299-
| non-null | Guards.cs:93:13:93:19 | access to type Console |
300-
| non-null | Guards.cs:95:13:95:19 | access to type Console |
301155
| non-null | Guards.cs:96:18:96:19 | "" |
302-
| non-null | Guards.cs:97:13:97:19 | access to type Console |
303-
| non-null | Guards.cs:97:31:97:31 | access to parameter s |
304-
| non-null | Guards.cs:99:13:99:19 | access to type Console |
305-
| non-null | Guards.cs:104:13:104:13 | access to parameter g |
306156
| non-null | Guards.cs:105:19:105:33 | object creation of type Exception |
307-
| non-null | Guards.cs:106:9:106:9 | access to parameter g |
308-
| non-null | Guards.cs:106:9:106:18 | access to property Property |
309-
| non-null | Guards.cs:107:9:107:15 | access to type Console |
310-
| non-null | Guards.cs:107:27:107:27 | access to parameter g |
311-
| non-null | Guards.cs:108:9:108:15 | access to type Console |
312-
| non-null | Guards.cs:108:27:108:27 | access to parameter g |
313-
| non-null | Guards.cs:108:27:108:36 | access to property Property |
314-
| non-null | Guards.cs:113:21:113:21 | access to parameter g |
315-
| non-null | Guards.cs:114:14:114:14 | access to parameter g |
316-
| non-null | Guards.cs:114:14:114:23 | access to property Property |
317-
| non-null | Guards.cs:114:14:114:32 | access to property Property |
318-
| non-null | Guards.cs:115:9:115:55 | ... = ... |
319-
| non-null | Guards.cs:115:17:115:17 | access to parameter g |
320-
| non-null | Guards.cs:115:17:115:26 | access to property Property |
321-
| non-null | Guards.cs:115:17:115:35 | access to property Property |
322-
| non-null | Guards.cs:115:17:115:55 | ... ?? ... |
323-
| non-null | Guards.cs:115:46:115:55 | throw ... |
324-
| non-null | Guards.cs:116:9:116:15 | access to type Console |
325-
| non-null | Guards.cs:116:27:116:27 | access to parameter g |
326-
| non-null | Guards.cs:116:27:116:36 | access to property Property |
327-
| non-null | Guards.cs:116:27:116:45 | access to property Property |
328-
| non-null | Guards.cs:116:27:116:51 | access to field Field |
329-
| non-null | Guards.cs:117:9:117:9 | access to parameter g |
330-
| non-null | Guards.cs:117:9:117:18 | access to property Property |
331-
| non-null | Guards.cs:118:9:118:15 | access to type Console |
332-
| non-null | Guards.cs:118:27:118:27 | access to parameter g |
333-
| non-null | Guards.cs:119:9:119:15 | access to type Console |
334-
| non-null | Guards.cs:119:27:119:27 | access to parameter g |
335-
| non-null | Guards.cs:119:27:119:36 | access to property Property |
336-
| non-null | Guards.cs:125:18:125:19 | access to parameter s1 |
337-
| non-null | Guards.cs:125:29:125:30 | access to parameter s1 |
338-
| non-null | Guards.cs:132:16:132:16 | access to parameter s |
339-
| non-null | Guards.cs:138:20:138:20 | access to parameter s |
340-
| non-null | Guards.cs:145:20:145:20 | access to local variable s |
341-
| non-null | Guards.cs:154:24:154:24 | access to parameter o |
342-
| non-null | Guards.cs:156:24:156:24 | access to local variable a |
343-
| non-null | Guards.cs:158:24:158:24 | access to parameter o |
344-
| non-null | Guards.cs:162:24:162:24 | access to parameter o |
345-
| non-null | Guards.cs:168:14:168:19 | access to type String |
346-
| non-null | Guards.cs:169:13:169:19 | access to type Console |
347-
| non-null | Guards.cs:169:31:169:31 | access to parameter x |
348157
| non-null | Guards.cs:183:38:183:49 | this access |
349158
| non-null | Guards.cs:189:14:189:25 | this access |
350-
| non-null | Guards.cs:190:13:190:19 | access to type Console |
351159
| non-null | Guards.cs:191:14:191:25 | this access |
352-
| non-null | Guards.cs:192:13:192:19 | access to type Console |
353160
| non-null | Guards.cs:193:14:193:25 | this access |
354-
| non-null | Guards.cs:194:13:194:19 | access to type Console |
355161
| non-null | Guards.cs:195:13:195:27 | this access |
356-
| non-null | Guards.cs:196:13:196:19 | access to type Console |
357162
| non-null | Guards.cs:197:14:197:29 | this access |
358-
| non-null | Guards.cs:198:13:198:19 | access to type Console |
359-
| non-null | Guards.cs:205:13:205:13 | access to parameter o |
360-
| non-null | Guards.cs:206:33:206:36 | access to parameter args |
361-
| non-null | Guards.cs:208:17:208:17 | access to parameter o |
362163
| non-null | Guards.cs:268:30:268:41 | call to method GetType |
363-
| non-null | Guards.cs:269:13:269:14 | access to parameter o1 |
364-
| non-null | Guards.cs:270:30:270:31 | access to parameter o2 |
365-
| non-null | Guards.cs:279:17:279:17 | access to parameter o |
366-
| non-null | Guards.cs:281:17:281:17 | access to local variable a |
367-
| non-null | Guards.cs:283:17:283:17 | access to parameter o |
368-
| non-null | Guards.cs:287:17:287:17 | access to parameter o |
369164
| non-null | Guards.cs:341:31:341:32 | "" |
370-
| non-null | Guards.cs:343:13:343:19 | access to type Console |
371-
| non-null | Guards.cs:343:31:343:31 | access to local variable s |
372-
| non-null | Guards.cs:349:13:349:13 | access to parameter o |
373165
| null | Assert.cs:9:24:9:27 | null |
374166
| null | Assert.cs:10:27:10:30 | null |
375167
| null | Assert.cs:16:24:16:27 | null |

0 commit comments

Comments
 (0)