Skip to content

Commit 90ea10e

Browse files
committed
Use location of elt for ImplicitLiteralElementIndexInstruction
1 parent f34c3b1 commit 90ea10e

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

go/ql/lib/semmle/go/controlflow/IR.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -647,9 +647,7 @@ module IR {
647647
override predicate hasLocationInfo(
648648
string filepath, int startline, int startcolumn, int endline, int endcolumn
649649
) {
650-
elt.hasLocationInfo(filepath, startline, startcolumn, _, _) and
651-
endline = startline and
652-
endcolumn = startcolumn
650+
elt.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
653651
}
654652
}
655653

go/ql/test/library-tests/semmle/go/controlflow/ControlFlowGraph/ControlFlowNode_getASuccessor.expected

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,16 @@
171171
| exprs.go:15:49:15:57 | selection of x | exprs.go:15:46:15:57 | init of key-value pair |
172172
| exprs.go:16:2:16:5 | assignment to arr1 | exprs.go:17:2:17:5 | skip |
173173
| exprs.go:16:2:16:5 | skip | exprs.go:16:10:16:26 | array literal |
174-
| exprs.go:16:10:16:26 | array literal | exprs.go:16:17:16:17 | element index |
175-
| exprs.go:16:17:16:17 | element index | exprs.go:16:17:16:23 | struct3 |
174+
| exprs.go:16:10:16:26 | array literal | exprs.go:16:17:16:25 | element index |
176175
| exprs.go:16:17:16:23 | struct3 | exprs.go:16:17:16:25 | selection of x |
176+
| exprs.go:16:17:16:25 | element index | exprs.go:16:17:16:23 | struct3 |
177177
| exprs.go:16:17:16:25 | init of selection of x | exprs.go:16:2:16:5 | assignment to arr1 |
178178
| exprs.go:16:17:16:25 | selection of x | exprs.go:16:17:16:25 | init of selection of x |
179179
| exprs.go:17:2:17:5 | assignment to arr2 | exprs.go:18:2:18:4 | skip |
180180
| exprs.go:17:2:17:5 | skip | exprs.go:17:10:17:40 | array literal |
181-
| exprs.go:17:10:17:40 | array literal | exprs.go:17:19:17:19 | element index |
182-
| exprs.go:17:19:17:19 | element index | exprs.go:17:19:17:25 | struct3 |
181+
| exprs.go:17:10:17:40 | array literal | exprs.go:17:19:17:27 | element index |
183182
| exprs.go:17:19:17:25 | struct3 | exprs.go:17:19:17:27 | selection of x |
183+
| exprs.go:17:19:17:27 | element index | exprs.go:17:19:17:25 | struct3 |
184184
| exprs.go:17:19:17:27 | init of selection of x | exprs.go:17:30:17:30 | 2 |
185185
| exprs.go:17:19:17:27 | selection of x | exprs.go:17:19:17:27 | init of selection of x |
186186
| exprs.go:17:30:17:30 | 2 | exprs.go:17:33:17:36 | arr1 |

0 commit comments

Comments
 (0)