From fdcdb141018a9c0094918a9427cd05fcb3f77f97 Mon Sep 17 00:00:00 2001 From: Denis Isaev Date: Tue, 8 Jan 2019 14:48:22 +0300 Subject: [PATCH] Workaround crash See https://github.com/golang/go/issues/29612 --- ssa/func.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ssa/func.go b/ssa/func.go index 53635ba01..8e958c422 100644 --- a/ssa/func.go +++ b/ssa/func.go @@ -265,6 +265,10 @@ func (f *Function) createSyntacticParams(recv *ast.FieldList, functype *ast.Func } } +type setNumable interface { + setNum(int) +} + // numberRegisters assigns numbers to all SSA registers // (value-defining Instructions) in f, to aid debugging. // (Non-Instruction Values are named at construction.) @@ -275,9 +279,7 @@ func numberRegisters(f *Function) { for _, instr := range b.Instrs { switch instr.(type) { case Value: - instr.(interface { - setNum(int) - }).setNum(v) + instr.(setNumable).setNum(v) v++ } }