Commit 4be7af23 authored by Matthew Dempsky's avatar Matthew Dempsky
Browse files

[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: default avatarDavid Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
parent 35b9c666
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment