From: Michael Matloob Date: Tue, 3 Dec 2024 21:23:18 +0000 (-0500) Subject: cmd/go/testdata/script: skip EndSequence entries in build_trimpath_cgo X-Git-Tag: go1.24rc1~21 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1fe65836aca009343274443411f7120d70434ddb;p=gostls13.git cmd/go/testdata/script: skip EndSequence entries in build_trimpath_cgo The TestScript/build_trimpath_cgo test for cmd/go 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. Fixes #70669 Change-Id: I421a2a9348e727e3ac4a3d42baa4d206cfbc047b Reviewed-on: https://go-review.googlesource.com/c/go/+/633038 LUCI-TryBot-Result: Go LUCI Reviewed-by: Cherry Mui Reviewed-by: Than McIntosh --- diff --git a/src/cmd/go/testdata/script/build_trimpath_cgo.txt b/src/cmd/go/testdata/script/build_trimpath_cgo.txt index 528982442d..b0cc401ad6 100644 --- a/src/cmd/go/testdata/script/build_trimpath_cgo.txt +++ b/src/cmd/go/testdata/script/build_trimpath_cgo.txt @@ -121,6 +121,9 @@ func run(exePath string) ([]string, error) { } return nil, err } + if le.EndSequence { + continue + } files[le.File.Name] = true } }