pass: cfg tests

This commit is contained in:
Michael McLoughlin
2018-12-02 13:50:55 -08:00
parent 43575d8b61
commit bc7d0fa410
3 changed files with 227 additions and 7 deletions

View File

@@ -75,7 +75,9 @@ func CFG(fn *avo.Function) error {
// Populate predecessors.
for _, i := range is {
for _, s := range i.Succ {
s.Pred = append(s.Pred, i)
if s != nil {
s.Pred = append(s.Pred, i)
}
}
}