Commit ef24795c authored by Ben Karel's avatar Ben Karel

Improve fix to handle irreducible CFGs.

parent b4ed37c2
......@@ -48,8 +48,10 @@ domLattice = addPoints "dominators" extend
extend :: JoinFun DPath
extend _ (OldFact (DPath l)) (NewFact (DPath l')) =
(changeIf (l `lengthDiffers` j), DPath j)
where j = filter (\elem -> Set.member elem common) l
where lx = filter (\elem -> Set.member elem common) l
rx = filter (\elem -> Set.member elem common) l'
common = Set.intersection (Set.fromList l) (Set.fromList l')
j = [x | (x, y) <- zip lx rx, x == y]
lengthDiffers [] [] = False
lengthDiffers (_:xs) (_:ys) = lengthDiffers xs ys
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment