]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/testdata/script: skip EndSequence entries in build_trimpath_cgo
authorMichael Matloob <matloob@golang.org>
Tue, 3 Dec 2024 21:23:18 +0000 (16:23 -0500)
committerMichael Matloob <matloob@golang.org>
Thu, 5 Dec 2024 19:15:00 +0000 (19:15 +0000)
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>
src/cmd/go/testdata/script/build_trimpath_cgo.txt

index 528982442d2c9fed3e70f747ff3ebdeb5f600e71..b0cc401ad679158a64a7283b291ce0d47c2777c7 100644 (file)
@@ -121,6 +121,9 @@ func run(exePath string) ([]string, error) {
                                }
                                return nil, err
                        }
+                       if le.EndSequence {
+                           continue
+                       }
                        files[le.File.Name] = true
                }
        }