diff --git a/call.go b/call.go index c2a6200..a2f8b51 100644 --- a/call.go +++ b/call.go @@ -181,13 +181,14 @@ func (c *calledFrom) succs(b *ssa.BasicBlock) bool { return false } + var called bool for _, s := range b.Succs { - if !c.instrs(s.Instrs) && !c.succs(s) { - return false + if c.instrs(s.Instrs) || c.succs(s) { + called = true } } - return true + return called } // CalledFrom checks whether receiver's method is called in an instruction