Skip to content

Commit

Permalink
cmd/go/testdata/script: skip EndSequence entries in build_trimpath_cgo
Browse files Browse the repository at this point in the history
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@golang.org>
  • Loading branch information
matloob committed Dec 5, 2024
1 parent 6293a06 commit 1fe6583
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cmd/go/testdata/script/build_trimpath_cgo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ func run(exePath string) ([]string, error) {
}
return nil, err
}
if le.EndSequence {
continue
}
files[le.File.Name] = true
}
}
Expand Down

0 comments on commit 1fe6583

Please sign in to comment.