CL 283672 added a flag to prevent double walking, use that flag instead
of checking SwitchStmt.Compiled field.
Passes toolstash -cmp.
Change-Id: Idb8f9078412fb789f51ed4fc4206638011e38a93
Reviewed-on: https://go-review.googlesource.com/c/go/+/283733
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
// walkSwitch walks a switch statement.
func walkSwitch(sw *ir.SwitchStmt) {
// Guard against double walk, see #25776.
- if len(sw.Cases) == 0 && len(sw.Compiled) > 0 {
+ if sw.Walked() {
return // Was fatal, but eliminating every possible source of double-walking is hard
}
+ sw.SetWalked(true)
if sw.Tag != nil && sw.Tag.Op() == ir.OTYPESW {
walkSwitchType(sw)