Skip to content

Commit 33fb481

Browse files
qmuntalgopherbot
authored andcommitted
cmd/compile/internal/ssa: skip EndSequence entries in TestStmtLines
The TestStmtLines test has been accessing a nil pointer when it tries to look up LineEntry.File.Name on a line entry with EndSequence set to true. The doc for EndSequence specifies that if EndSequence is set, only it and the Address field are meaningful. Skip the entries with EndSequence set when building the set of files. I've reproduced this issue locally. Probably also fixes #49372, but will leave that for a follow-up CL. Fixes #74475 Updates #49372 Change-Id: Ic0664f7652b52a0a20239d13fe16454622740821 Reviewed-on: https://go-review.googlesource.com/c/go/+/685835 Reviewed-by: Than McIntosh <[email protected]> Reviewed-by: Carlos Amedee <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Bypass: Dmitri Shuralyov <[email protected]> Auto-Submit: Quim Muntal <[email protected]>
1 parent a995269 commit 33fb481

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cmd/compile/internal/ssa/stmtlines_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ func TestStmtLines(t *testing.T) {
120120
break
121121
}
122122
must(err)
123+
if le.EndSequence {
124+
// When EndSequence is true only
125+
// le.Address is meaningful, skip.
126+
continue
127+
}
123128
fl := Line{le.File.Name, le.Line}
124129
lines[fl] = lines[fl] || le.IsStmt
125130
}

0 commit comments

Comments
 (0)