From c70a7849af56828462ed7d2a5051d917ef6432dc Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Fri, 12 Apr 2019 12:02:49 -0700 Subject: [PATCH] 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 --- src/cmd/internal/obj/plist.go | 3 +++ 1 file changed, 3 insertions(+) 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) } -- 2.51.0