]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: fix ICE during ir.Dump
authorMatthew Dempsky <mdempsky@google.com>
Fri, 15 Jan 2021 03:40:07 +0000 (19:40 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 15 Jan 2021 04:08:47 +0000 (04:08 +0000)
commit4be7af23f97fe8d1b4210acde6789cf621564ec6
treef528a846d9c31baa15e65a235e3fba9328a3d543
parent35b9c666012dcc5203a1362f10fe5279df163a1a
[dev.regabi] cmd/compile: fix ICE during ir.Dump

fmt.go:dumpNodeHeader uses reflection to call all "func() bool"-typed
methods on Nodes during printing, but the OnStack method that I added
in CL 283233 isn't meant to be called on non-variables.

dumpNodeHeader does already guard against panics, as happen in some
other accessors, but not against Fatalf, as I was using in OnStack. So
simply change OnStack to use panic too.

Thanks to drchase@ for the report.

Change-Id: I0cfac84a96292193401a32fc5e7fd3c48773e008
Reviewed-on: https://go-review.googlesource.com/c/go/+/284074
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/compile/internal/ir/name.go