Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit fdcdb14

Browse files
committed
Workaround crash
See golang/go#29612
1 parent 95959ea commit fdcdb14

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ssa/func.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ func (f *Function) createSyntacticParams(recv *ast.FieldList, functype *ast.Func
265265
}
266266
}
267267

268+
type setNumable interface {
269+
setNum(int)
270+
}
271+
268272
// numberRegisters assigns numbers to all SSA registers
269273
// (value-defining Instructions) in f, to aid debugging.
270274
// (Non-Instruction Values are named at construction.)
@@ -275,9 +279,7 @@ func numberRegisters(f *Function) {
275279
for _, instr := range b.Instrs {
276280
switch instr.(type) {
277281
case Value:
278-
instr.(interface {
279-
setNum(int)
280-
}).setNum(v)
282+
instr.(setNumable).setNum(v)
281283
v++
282284
}
283285
}

0 commit comments

Comments
 (0)