diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-01-11 19:58:55 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-01-11 19:58:55 +0000 |
commit | a00565edae146641408cdc4ecf745a89a4c7ac8c (patch) | |
tree | d05fcc4b41049751e0fc32fc5ec9d873f6c67497 /libgo | |
parent | f7463a995bab96d23a493a8636d67b2cec368df9 (diff) | |
download | gcc-a00565edae146641408cdc4ecf745a89a4c7ac8c.tar.gz |
PR go/83794
misc/cgo/test: avoid endless loop when we can't parse notes
Reviewed-on: https://go-review.googlesource.com/87416
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256553 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/misc/cgo/test/buildid_linux.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libgo/misc/cgo/test/buildid_linux.go b/libgo/misc/cgo/test/buildid_linux.go index 47dd87128ff..84d3edb664e 100644 --- a/libgo/misc/cgo/test/buildid_linux.go +++ b/libgo/misc/cgo/test/buildid_linux.go @@ -27,6 +27,7 @@ func testBuildID(t *testing.T) { defer f.Close() c := 0 +sections: for i, s := range f.Sections { if s.Type != elf.SHT_NOTE { continue @@ -47,7 +48,7 @@ func testBuildID(t *testing.T) { if len(d) < 12 { t.Logf("note section %d too short (%d < 12)", i, len(d)) - continue + continue sections } namesz := f.ByteOrder.Uint32(d) @@ -59,7 +60,7 @@ func testBuildID(t *testing.T) { 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 |