From 1fe65836aca009343274443411f7120d70434ddb Mon Sep 17 00:00:00 2001 From: Michael Matloob Date: Tue, 3 Dec 2024 16:23:18 -0500 Subject: [PATCH] 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 --- src/cmd/go/testdata/script/build_trimpath_cgo.txt | 3 +++ 1 file changed, 3 insertions(+) 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 } } -- 2.48.1