From: Josh Bleecher Snyder Date: Fri, 12 Apr 2019 19:02:49 +0000 (-0700) Subject: cmd/internal/obj: stop plist flushing early on error X-Git-Tag: go1.13beta1~716 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c70a7849af56828462ed7d2a5051d917ef6432dc;p=gostls13.git cmd/internal/obj: stop plist flushing early on error If preprocessing or assembling has failed, we should not proceed. First, there's no point. Second, I will shortly add some sanity checks to linkpcln that will fail on malformed input. Change-Id: I055eeab1c2f3a66b4b2cadb551bbf4ab55d176f4 Reviewed-on: https://go-review.googlesource.com/c/go/+/171886 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/internal/obj/plist.go b/src/cmd/internal/obj/plist.go index 9d376f739f..8b177c5a02 100644 --- a/src/cmd/internal/obj/plist.go +++ b/src/cmd/internal/obj/plist.go @@ -105,6 +105,9 @@ func Flushplist(ctxt *Link, plist *Plist, newprog ProgAlloc, myimportpath string linkpatch(ctxt, s, newprog) ctxt.Arch.Preprocess(ctxt, s, newprog) ctxt.Arch.Assemble(ctxt, s, newprog) + if ctxt.Errors > 0 { + continue + } linkpcln(ctxt, s) ctxt.populateDWARF(plist.Curfn, s, myimportpath) }