PR go/83794
misc/cgo/test: avoid endless loop when we can't parse notes
Reviewed-on: https://go-review.googlesource.com/87416
From-SVN: r256553
-1176dd2b53f2d2b826b599a126f3f9828283cec3
+fe8481db9f5b37eb9a0c329673789eaaf1335598
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
defer f.Close()
c := 0
+sections:
for i, s := range f.Sections {
if s.Type != elf.SHT_NOTE {
continue
if len(d) < 12 {
t.Logf("note section %d too short (%d < 12)", i, len(d))
- continue
+ continue sections
}
namesz := f.ByteOrder.Uint32(d)
if int(12+an+ad) > len(d) {
t.Logf("note section %d too short for header (%d < 12 + align(%d,4) + align(%d,4))", i, len(d), namesz, descsz)
- continue
+ continue sections
}
// 3 == NT_GNU_BUILD_ID