]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: make Exitf panic under -h
authorCherry Mui <cherryyz@google.com>
Wed, 22 Feb 2023 17:09:56 +0000 (12:09 -0500)
committerCherry Mui <cherryyz@google.com>
Wed, 22 Feb 2023 20:39:11 +0000 (20:39 +0000)
If the -h flag is specified, currently it makes Errorf panic, but
not Exitf. Do so for Exitf as well.

Change-Id: I3e8d8899fd439f7299be3f9e9a63993b04852a93
Reviewed-on: https://go-review.googlesource.com/c/go/+/470297
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/internal/ld/util.go

index 779f4988b68a3aa107843c063aff6297d17b04da..63b7e0d3299da11b14e6a32a36a2466fb3390558 100644 (file)
@@ -35,6 +35,9 @@ func Exit(code int) {
 func Exitf(format string, a ...interface{}) {
        fmt.Fprintf(os.Stderr, os.Args[0]+": "+format+"\n", a...)
        nerrors++
+       if *flagH {
+               panic("error")
+       }
        Exit(2)
 }