cmd/asm: fix EOF message on operand parsing errors.

If the parsing of an operand completes but the parser thinks there
is more to read, return an "expected end of operand" error message
instead of "expected EOF." This also removes extra "asm: " prefixes
in error strings since "asm: " is already set as the global log
prefix.

Fixes #14071

Change-Id: I7d621c1aea529a0eca3bcba032359bd25b3e1080
Reviewed-on: https://go-review.googlesource.com/19731
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Tal Shprecher 2016-02-19 16:02:54 -08:00 committed by Rob Pike
parent d17727bdb4
commit 45c4ebec5b
5 changed files with 21 additions and 16 deletions

View file

@ -26,7 +26,7 @@ func main() {
architecture := arch.Set(GOARCH)
if architecture == nil {
log.Fatalf("asm: unrecognized architecture %s", GOARCH)
log.Fatalf("unrecognized architecture %s", GOARCH)
}
flags.Parse()
@ -66,7 +66,7 @@ func main() {
obj.Writeobjdirect(ctxt, output)
}
if !ok || diag {
log.Printf("asm: assembly of %s failed", flag.Arg(0))
log.Printf("assembly of %s failed", flag.Arg(0))
os.Remove(*flags.OutputFile)
os.Exit(1)
}