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

Commit

Permalink
Workaround crash
Browse files Browse the repository at this point in the history
  • Loading branch information
jirfag committed Jan 8, 2019
1 parent 3f1c825 commit a45e3a4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ssa/func.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand All @@ -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++
}
}
Expand Down

0 comments on commit a45e3a4

Please sign in to comment.