Skip to content

Commit cda599e

Browse files
committed
Remove identity steps
1 parent 38cb6e5 commit cda599e

File tree

22 files changed

+2
-140
lines changed

22 files changed

+2
-140
lines changed

go/ql/lib/semmle/go/dataflow/SsaImpl.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,8 @@ private module Internal {
387387
or
388388
maxSsaRefRank(b1, v) = ssaRefRank(b1, i1, v, _) and
389389
varBlockStep(v, b1, b2) and
390-
ssaRefRank(b2, i2, v, _) = 1
390+
ssaRefRank(b2, i2, v, _) = 1 and
391+
not (b1 = b2 and i1 = i2)
391392
}
392393

393394
predicate variableUse(SsaSourceVariable v, IR::Instruction use, ReachableBasicBlock bb, int i) {

go/ql/test/example-tests/snippets/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 3 deletions
This file was deleted.

go/ql/test/experimental/CWE-400/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 4 deletions
This file was deleted.

go/ql/test/experimental/CWE-522-DecompressionBombs/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,3 @@ reverseRead
3434
| test.go:92:19:92:25 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
3535
| test.go:93:5:93:11 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
3636
| test.go:94:9:94:15 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
37-
identityLocalStep
38-
| test.go:114:37:114:38 | rc | Node steps to itself |
39-
| test.go:198:27:198:29 | out | Node steps to itself |
40-
| test.go:224:27:224:29 | out | Node steps to itself |
41-
| test.go:249:27:249:29 | out | Node steps to itself |
42-
| test.go:274:27:274:29 | out | Node steps to itself |
43-
| test.go:299:27:299:29 | out | Node steps to itself |
44-
| test.go:324:26:324:28 | out | Node steps to itself |
45-
| test.go:349:26:349:28 | out | Node steps to itself |
46-
| test.go:375:28:375:30 | out | Node steps to itself |
47-
| test.go:403:28:403:30 | out | Node steps to itself |
48-
| test.go:431:24:431:26 | out | Node steps to itself |
49-
| test.go:463:26:463:28 | out | Node steps to itself |
50-
| test.go:490:26:490:28 | out | Node steps to itself |
51-
| test.go:517:27:517:29 | out | Node steps to itself |
52-
| test.go:546:26:546:28 | out | Node steps to itself |
53-
| test.go:571:26:571:28 | out | Node steps to itself |
54-
| test.go:601:24:601:26 | out | Node steps to itself |
55-
| test.go:614:15:614:21 | tarRead | Node steps to itself |
56-
| test.go:622:3:622:7 | files | Node steps to itself |
57-
| test.go:637:10:637:16 | tarRead | Node steps to itself |
58-
| test.go:647:10:647:16 | tarRead | Node steps to itself |

go/ql/test/experimental/CWE-942/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,3 @@ reverseRead
1313
| CorsMisconfiguration.go:170:14:170:16 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
1414
| CorsMisconfiguration.go:194:17:194:19 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
1515
| CorsMisconfiguration.go:206:14:206:16 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
16-
identityLocalStep
17-
| CorsMisconfiguration.go:208:13:208:18 | origin | Node steps to itself |
18-
| CorsMisconfiguration.go:235:6:235:8 | try | Node steps to itself |

go/ql/test/library-tests/semmle/go/dataflow/ExternalTaintFlow/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,3 @@ reverseRead
22
| test.go:90:10:90:15 | taint8 | Origin of readStep is missing a PostUpdateNode. |
33
| test.go:104:12:104:18 | taint10 | Origin of readStep is missing a PostUpdateNode. |
44
| test.go:150:10:150:14 | slice | Origin of readStep is missing a PostUpdateNode. |
5-
identityLocalStep
6-
| test.go:92:3:92:3 | b | Node steps to itself |
7-
| test.go:95:3:95:3 | b | Node steps to itself |
8-
| test.go:106:3:106:3 | b | Node steps to itself |
9-
| test.go:109:3:109:3 | b | Node steps to itself |
10-
| test.go:119:3:119:3 | b | Node steps to itself |
11-
| test.go:122:3:122:3 | b | Node steps to itself |
12-
| test.go:125:3:125:3 | b | Node steps to itself |
13-
| test.go:128:3:128:3 | b | Node steps to itself |
14-
| test.go:138:3:138:3 | b | Node steps to itself |
15-
| test.go:141:3:141:3 | b | Node steps to itself |

go/ql/test/library-tests/semmle/go/dataflow/ExternalValueFlow/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,3 @@ reverseRead
22
| test.go:90:10:90:15 | taint8 | Origin of readStep is missing a PostUpdateNode. |
33
| test.go:104:12:104:18 | taint10 | Origin of readStep is missing a PostUpdateNode. |
44
| test.go:150:10:150:14 | slice | Origin of readStep is missing a PostUpdateNode. |
5-
identityLocalStep
6-
| test.go:92:3:92:3 | b | Node steps to itself |
7-
| test.go:95:3:95:3 | b | Node steps to itself |
8-
| test.go:106:3:106:3 | b | Node steps to itself |
9-
| test.go:109:3:109:3 | b | Node steps to itself |
10-
| test.go:119:3:119:3 | b | Node steps to itself |
11-
| test.go:122:3:122:3 | b | Node steps to itself |
12-
| test.go:125:3:125:3 | b | Node steps to itself |
13-
| test.go:128:3:128:3 | b | Node steps to itself |
14-
| test.go:138:3:138:3 | b | Node steps to itself |
15-
| test.go:141:3:141:3 | b | Node steps to itself |

go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,3 @@ reverseRead
1818
| test_jmoiron_sqlx.go:263:8:263:11 | rows | Origin of readStep is missing a PostUpdateNode. |
1919
| test_jmoiron_sqlx.go:265:6:265:9 | rows | Origin of readStep is missing a PostUpdateNode. |
2020
| test_jmoiron_sqlx.go:268:9:268:12 | rows | Origin of readStep is missing a PostUpdateNode. |
21-
identityLocalStep
22-
| test_couchbase_gocb_v1.go:20:6:20:7 | r1 | Node steps to itself |
23-
| test_couchbase_gocb_v1.go:40:6:40:7 | r2 | Node steps to itself |
24-
| test_mongo_driver_mongo.go:80:24:80:26 | ctx | Node steps to itself |
25-
| test_mongo_driver_mongo.go:103:24:103:26 | ctx | Node steps to itself |
26-
| test_mongo_driver_mongo.go:116:24:116:26 | ctx | Node steps to itself |
27-
| test_uptrace_bun.go:27:3:27:4 | db | Node steps to itself |
28-
| test_uptrace_bun.go:27:14:27:16 | ctx | Node steps to itself |

go/ql/test/library-tests/semmle/go/frameworks/Beego/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,3 @@ reverseRead
1414
| test.go:318:20:318:22 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
1515
| test.go:324:17:324:19 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
1616
| test.go:324:17:324:25 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
17-
identityLocalStep
18-
| test.go:278:3:278:14 | genericFiles | Node steps to itself |
19-
| test.go:278:21:278:25 | files | Node steps to itself |

go/ql/test/library-tests/semmle/go/frameworks/Revel/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,3 @@ reverseRead
169169
| examples/booking/app/models/booking.go:82:14:82:14 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
170170
| examples/booking/app/models/booking.go:83:17:83:17 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
171171
| examples/booking/app/models/booking.go:84:18:84:18 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
172-
identityLocalStep
173-
| examples/booking/app/controllers/app.go:95:10:95:10 | c | Node steps to itself |

0 commit comments

Comments
 (0)