diff --git a/ir/ir_test.go b/ir/ir_test.go index 3e7c24a0..7a4c8c36 100644 --- a/ir/ir_test.go +++ b/ir/ir_test.go @@ -117,6 +117,7 @@ var ( _ Terminator = (*TermRet)(nil) _ Terminator = (*TermBr)(nil) _ Terminator = (*TermCondBr)(nil) + _ Terminator = (*TermCallBr)(nil) _ Terminator = (*TermSwitch)(nil) _ Terminator = (*TermIndirectBr)(nil) _ Terminator = (*TermInvoke)(nil) diff --git a/ir/terminator.go b/ir/terminator.go index 529fdcb1..57a09fb7 100644 --- a/ir/terminator.go +++ b/ir/terminator.go @@ -518,6 +518,10 @@ type TermCallBr struct { Metadata } +func (term *TermCallBr) Operands() []value.Value { + return append(append(append([]value.Value{term.Callee}, term.Args...), term.NormalRetTarget), term.OtherRetTargets...) +} + // NewCallBr returns a new callbr terminator based on the given callee, function // arguments and control flow return points for normal and exceptional // execution.