From: Rob Pike Date: Wed, 8 Apr 2015 18:24:48 +0000 (-0700) Subject: cmd/asm: remove object file if assembly fails. X-Git-Tag: go1.5beta1~1239 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3b1d0d0f070f0ac5769017a227cac91ab0605559;p=gostls13.git cmd/asm: remove object file if assembly fails. Just an oversight. Plus the code had an unnecessary call to os.Exit that now has a purpose. Fixes #10372. Change-Id: I456018f3a01ca05b4501c7f8a4961d48ab8c5e16 Reviewed-on: https://go-review.googlesource.com/8651 Reviewed-by: Minux Ma --- diff --git a/src/cmd/asm/main.go b/src/cmd/asm/main.go index e8b10ce1ea..690ec2ef89 100644 --- a/src/cmd/asm/main.go +++ b/src/cmd/asm/main.go @@ -57,7 +57,8 @@ func main() { var ok bool pList.Firstpc, ok = parser.Parse() if !ok { - log.Fatalf("asm: assembly of %s failed", flag.Arg(0)) + log.Printf("asm: assembly of %s failed", flag.Arg(0)) + os.Remove(*flags.OutputFile) os.Exit(1) } obj.Writeobjdirect(ctxt, output)