File tree Expand file tree Collapse file tree 12 files changed +15
-21
lines changed
src/semmle/code/csharp/dataflow
test/library-tests/dataflow/ssa Expand file tree Collapse file tree 12 files changed +15
-21
lines changed Original file line number Diff line number Diff line change @@ -1430,7 +1430,14 @@ module Ssa {
14301430 ) {
14311431 possiblyLiveAtAllNodes ( bb , v ) and
14321432 callAt ( bb , i , call ) and
1433- relevantDefinition ( _, v .getAssignable ( ) , _)
1433+ exists ( Assignable a |
1434+ a = v .getAssignable ( ) and
1435+ relevantDefinition ( _, a , _) and
1436+ not exists ( AssignableDefinitions:: OutRefDefinition def |
1437+ def .getCall ( ) = call and
1438+ def .getTarget ( ) = a
1439+ )
1440+ )
14341441 }
14351442
14361443 /**
Original file line number Diff line number Diff line change @@ -245,10 +245,10 @@ void CaptureWrite()
245245 i = 1 ;
246246 }
247247
248- void CaptureAndRef ( ref int i )
248+ void CaptureAndRef ( ref int j )
249249 {
250250 CaptureWrite ( ) ;
251- i = 2 ;
251+ j = 2 ;
252252 }
253253
254254 CaptureAndRef ( ref i ) ; // explicit definition only (no call definition)
Original file line number Diff line number Diff line change 11| Capture.cs:81:28:81:28 | i | Capture.cs:81:34:81:36 | SSA def(i) |
2- | Capture.cs:248:36:248:36 | i | Capture.cs:251:13:251:17 | SSA def(i ) |
2+ | Capture.cs:248:36:248:36 | j | Capture.cs:251:13:251:17 | SSA def(j ) |
33| Consistency.cs:30:30:30:30 | c | Consistency.cs:32:9:32:29 | SSA def(c) |
44| DefUse.cs:114:42:114:42 | i | DefUse.cs:114:47:114:52 | SSA def(i) |
55| DefUse.cs:116:42:116:42 | i | DefUse.cs:116:47:116:51 | SSA def(i) |
Original file line number Diff line number Diff line change 3737| out | Capture.cs:139:13:139:13 | d | Capture.cs:142:13:142:17 | SSA def(d) | Capture.cs:144:9:144:12 | SSA call def(d) | Capture.cs:144:9:144:12 | call to local function M4 | false |
3838| out | Capture.cs:168:13:168:13 | h | Capture.cs:174:17:174:21 | SSA def(h) | Capture.cs:176:13:176:16 | SSA call def(h) | Capture.cs:176:13:176:16 | call to local function M9 | false |
3939| out | Capture.cs:229:13:229:13 | i | Capture.cs:235:21:235:25 | SSA def(i) | Capture.cs:236:9:236:12 | SSA call def(i) | Capture.cs:236:9:236:12 | call to local function M3 | false |
40- | out | Capture.cs:242:13:242:13 | i | Capture.cs:245:13:245:17 | SSA def(i) | Capture.cs:254:9:254:28 | SSA call def(i) | Capture.cs:254:9:254:28 | call to local function CaptureAndRef | true |
4140| out | DefUse.cs:167:23:167:23 | i | DefUse.cs:173:13:173:17 | SSA def(i) | DefUse.cs:181:9:181:11 | SSA call def(i) | DefUse.cs:181:9:181:11 | delegate call | false |
Original file line number Diff line number Diff line change 1- | Capture.cs:255:34:255:34 | access to local variable i | Read is associated with multiple SSA definitions |
Original file line number Diff line number Diff line change 8383| Capture.cs:229:13:229:13 | i | Capture.cs:235:21:235:25 | SSA def(i) |
8484| Capture.cs:229:13:229:13 | i | Capture.cs:236:9:236:12 | SSA call def(i) |
8585| Capture.cs:242:13:242:13 | i | Capture.cs:242:13:242:17 | SSA def(i) |
86- | Capture.cs:242:13:242:13 | i | Capture.cs:245:13:245:17 | SSA def(i) |
87- | Capture.cs:242:13:242:13 | i | Capture.cs:254:9:254:28 | SSA call def(i) |
8886| Capture.cs:242:13:242:13 | i | Capture.cs:254:27:254:27 | SSA def(i) |
89- | Capture.cs:248:36:248:36 | i | Capture.cs:251:13:251:17 | SSA def(i ) |
87+ | Capture.cs:248:36:248:36 | j | Capture.cs:251:13:251:17 | SSA def(j ) |
9088| Consistency.cs:7:25:7:25 | b | Consistency.cs:7:25:7:25 | SSA param(b) |
9189| Consistency.cs:15:17:15:17 | i | Consistency.cs:15:17:15:21 | SSA def(i) |
9290| Consistency.cs:15:17:15:17 | i | Consistency.cs:15:17:15:21 | [finally: exception(Exception)] SSA def(i) |
Original file line number Diff line number Diff line change 8383| Capture.cs:235:21:235:25 | SSA def(i) | Capture.cs:235:21:235:25 | ... = ... |
8484| Capture.cs:236:9:236:12 | SSA call def(i) | Capture.cs:236:9:236:12 | call to local function M3 |
8585| Capture.cs:242:13:242:17 | SSA def(i) | Capture.cs:242:13:242:17 | Int32 i = ... |
86- | Capture.cs:245:13:245:17 | SSA def(i) | Capture.cs:245:13:245:17 | ... = ... |
87- | Capture.cs:251:13:251:17 | SSA def(i) | Capture.cs:251:13:251:17 | ... = ... |
88- | Capture.cs:254:9:254:28 | SSA call def(i) | Capture.cs:254:9:254:28 | call to local function CaptureAndRef |
86+ | Capture.cs:251:13:251:17 | SSA def(j) | Capture.cs:251:13:251:17 | ... = ... |
8987| Capture.cs:254:27:254:27 | SSA def(i) | Capture.cs:254:9:254:28 | call to local function CaptureAndRef |
9088| Consistency.cs:7:25:7:25 | SSA param(b) | Consistency.cs:7:25:7:25 | b |
9189| Consistency.cs:15:17:15:21 | SSA def(i) | Consistency.cs:15:17:15:21 | Int32 i = ... |
Original file line number Diff line number Diff line change 5959| Capture.cs:229:13:229:13 | i | Capture.cs:231:9:231:49 | SSA capture def(i) | Capture.cs:231:47:231:47 | access to local variable i |
6060| Capture.cs:229:13:229:13 | i | Capture.cs:236:9:236:12 | SSA call def(i) | Capture.cs:237:34:237:34 | access to local variable i |
6161| Capture.cs:242:13:242:13 | i | Capture.cs:242:13:242:17 | SSA def(i) | Capture.cs:254:27:254:27 | access to local variable i |
62- | Capture.cs:242:13:242:13 | i | Capture.cs:254:9:254:28 | SSA call def(i) | Capture.cs:255:34:255:34 | access to local variable i |
6362| Capture.cs:242:13:242:13 | i | Capture.cs:254:27:254:27 | SSA def(i) | Capture.cs:255:34:255:34 | access to local variable i |
6463| Consistency.cs:7:25:7:25 | b | Consistency.cs:7:25:7:25 | SSA param(b) | Consistency.cs:11:17:11:17 | access to parameter b |
6564| Consistency.cs:15:17:15:17 | i | Consistency.cs:15:17:15:21 | SSA def(i) | Consistency.cs:16:17:16:17 | access to local variable i |
Original file line number Diff line number Diff line change 5555| Capture.cs:229:13:229:13 | i | Capture.cs:232:9:232:13 | SSA def(i) | Capture.cs:232:9:232:13 | ... = ... |
5656| Capture.cs:229:13:229:13 | i | Capture.cs:235:21:235:25 | SSA def(i) | Capture.cs:235:21:235:25 | ... = ... |
5757| Capture.cs:242:13:242:13 | i | Capture.cs:242:13:242:17 | SSA def(i) | Capture.cs:242:13:242:17 | Int32 i = ... |
58- | Capture.cs:242:13:242:13 | i | Capture.cs:245:13:245:17 | SSA def(i) | Capture.cs:245:13:245:17 | ... = ... |
5958| Capture.cs:242:13:242:13 | i | Capture.cs:254:27:254:27 | SSA def(i) | Capture.cs:254:27:254:27 | access to local variable i |
60- | Capture.cs:248:36:248:36 | i | Capture.cs:251:13:251:17 | SSA def(i ) | Capture.cs:251:13:251:17 | ... = ... |
59+ | Capture.cs:248:36:248:36 | j | Capture.cs:251:13:251:17 | SSA def(j ) | Capture.cs:251:13:251:17 | ... = ... |
6160| Consistency.cs:7:25:7:25 | b | Consistency.cs:7:25:7:25 | SSA param(b) | Consistency.cs:7:25:7:25 | b |
6261| Consistency.cs:15:17:15:17 | i | Consistency.cs:15:17:15:21 | SSA def(i) | Consistency.cs:15:17:15:21 | Int32 i = ... |
6362| Consistency.cs:15:17:15:17 | i | Consistency.cs:15:17:15:21 | [finally: exception(Exception)] SSA def(i) | Consistency.cs:15:17:15:21 | Int32 i = ... |
Original file line number Diff line number Diff line change 99| Capture.cs:139:13:139:13 | d | Capture.cs:144:9:144:12 | SSA call def(d) | Capture.cs:142:13:142:17 | ... = ... |
1010| Capture.cs:168:13:168:13 | h | Capture.cs:176:13:176:16 | SSA call def(h) | Capture.cs:174:17:174:21 | ... = ... |
1111| Capture.cs:229:13:229:13 | i | Capture.cs:236:9:236:12 | SSA call def(i) | Capture.cs:235:21:235:25 | ... = ... |
12- | Capture.cs:242:13:242:13 | i | Capture.cs:254:9:254:28 | SSA call def(i) | Capture.cs:245:13:245:17 | ... = ... |
1312| DefUse.cs:167:23:167:23 | i | DefUse.cs:181:9:181:11 | SSA call def(i) | DefUse.cs:173:13:173:17 | ... = ... |
1413| DefUse.cs:184:9:184:14 | this.Field5 | DefUse.cs:191:9:191:11 | SSA call def(this.Field5) | DefUse.cs:188:13:188:22 | ... = ... |
1514| Example.cs:8:9:8:18 | this.Field | Example.cs:13:13:13:23 | SSA call def(this.Field) | Example.cs:8:9:8:22 | ... = ... |
You can’t perform that action at this time.
0 commit comments