From: Russ Cox Date: Mon, 30 Nov 2020 14:34:34 +0000 (-0500) Subject: [dev.regabi] cmd/compile: fix -h X-Git-Tag: go1.17beta1~1539^2~412 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=41ad4dec99;p=gostls13.git [dev.regabi] cmd/compile: fix -h The compile -h flag is *meant* to panic, so you can see the stack trace where the error is being printed. Make it do that again. Change-Id: Ieb0042863582d7a4c5d08d2f866a144962915b06 Reviewed-on: https://go-review.googlesource.com/c/go/+/274116 Trust: Russ Cox Reviewed-by: Matthew Dempsky --- diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index 7bad05265d..718239484b 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -43,6 +43,9 @@ func hidePanic() { // about a panic too; let the user clean up // the code and try again. if err := recover(); err != nil { + if err == "-h" { + panic(err) + } base.ErrorExit() } }