aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2025-07-04 12:45:42 +0200
committerGopher Robot <gobot@golang.org>2025-07-07 09:14:56 -0700
commit33fb4819f59d16c483be6cf2016f79eef3543691 (patch)
treef0f1be6e28b0fca572a65fd98bd4315e935a1ace
parenta995269a9383d90a3bdd029989bafc8fc3b19dc3 (diff)
downloadgo-33fb4819f59d16c483be6cf2016f79eef3543691.tar.xz
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 <thanm@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org> Auto-Submit: Quim Muntal <quimmuntal@gmail.com>
-rw-r--r--src/cmd/compile/internal/ssa/stmtlines_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/stmtlines_test.go b/src/cmd/compile/internal/ssa/stmtlines_test.go
index e17a5402af..8cd11e9828 100644
--- a/src/cmd/compile/internal/ssa/stmtlines_test.go
+++ b/src/cmd/compile/internal/ssa/stmtlines_test.go
@@ -120,6 +120,11 @@ func TestStmtLines(t *testing.T) {
break
}
must(err)
+ if le.EndSequence {
+ // When EndSequence is true only
+ // le.Address is meaningful, skip.
+ continue
+ }
fl := Line{le.File.Name, le.Line}
lines[fl] = lines[fl] || le.IsStmt
}