]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/asm: remove object file if assembly fails.
authorRob Pike <r@golang.org>
Wed, 8 Apr 2015 18:24:48 +0000 (11:24 -0700)
committerRob Pike <r@golang.org>
Wed, 8 Apr 2015 18:29:17 +0000 (18:29 +0000)
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 <minux@golang.org>
src/cmd/asm/main.go

index e8b10ce1eac710386b9e6d3df488b851f5f4f9cc..690ec2ef893024ec7e641595947cb3ec247e47df 100644 (file)
@@ -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)