Commit c70a7849 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

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 <josharian@gmail.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 8c7564de
...@@ -105,6 +105,9 @@ func Flushplist(ctxt *Link, plist *Plist, newprog ProgAlloc, myimportpath string ...@@ -105,6 +105,9 @@ func Flushplist(ctxt *Link, plist *Plist, newprog ProgAlloc, myimportpath string
linkpatch(ctxt, s, newprog) linkpatch(ctxt, s, newprog)
ctxt.Arch.Preprocess(ctxt, s, newprog) ctxt.Arch.Preprocess(ctxt, s, newprog)
ctxt.Arch.Assemble(ctxt, s, newprog) ctxt.Arch.Assemble(ctxt, s, newprog)
if ctxt.Errors > 0 {
continue
}
linkpcln(ctxt, s) linkpcln(ctxt, s)
ctxt.populateDWARF(plist.Curfn, s, myimportpath) ctxt.populateDWARF(plist.Curfn, s, myimportpath)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment