]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.link] cmd/link: fix funcfunctab crash with darwin + plugin
authorThan McIntosh <thanm@google.com>
Mon, 13 Apr 2020 11:31:19 +0000 (07:31 -0400)
committerThan McIntosh <thanm@google.com>
Mon, 13 Apr 2020 13:21:48 +0000 (13:21 +0000)
Fix a bug in findfunctab when building plugin on Darwin (this is
a regression introduced by CL 227842).

Change-Id: Ic610168e45a750c0a2f2b8611d5d9154e6c2622f
Reviewed-on: https://go-review.googlesource.com/c/go/+/228137
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
src/cmd/link/internal/ld/pcln.go

index 9e2a4b2ffa169300a9f2c2143ed92e9f68893884..b275d208566dabc69611d6784bf244018185dd20 100644 (file)
@@ -601,7 +601,7 @@ func (ctxt *Link) findfunctab(container loader.Bitmap) {
                if i < len(ctxt.Textp2) {
                        e = ctxt.Textp2[i]
                }
-               for !emitPcln(ctxt, e, container) && i < len(ctxt.Textp2) {
+               for e != 0 && !emitPcln(ctxt, e, container) && i < len(ctxt.Textp2) {
                        e = ctxt.Textp2[i]
                        i++
                }