Skip to content

Commit 1fe6583

Browse files
committed
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 <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
1 parent 6293a06 commit 1fe6583

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/cmd/go/testdata/script/build_trimpath_cgo.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ func run(exePath string) ([]string, error) {
121121
}
122122
return nil, err
123123
}
124+
if le.EndSequence {
125+
continue
126+
}
124127
files[le.File.Name] = true
125128
}
126129
}

0 commit comments

Comments
 (0)