From 5b299672621f281f37e7149d497a9ad2046127f7 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 21 Dec 2017 14:27:53 -0500 Subject: [PATCH] Swap the order of the parameters to go. --- src/Analysis/Abstract/Collecting.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Analysis/Abstract/Collecting.hs b/src/Analysis/Abstract/Collecting.hs index b6b63b8d7..b8eac3edb 100644 --- a/src/Analysis/Abstract/Collecting.hs +++ b/src/Analysis/Abstract/Collecting.hs @@ -44,9 +44,9 @@ reachable :: ( Ord (LocationFor a) => Live (LocationFor a) a -- ^ The set of root addresses. -> Store (LocationFor a) a -- ^ The store to trace addresses through. -> Live (LocationFor a) a -- ^ The set of addresses reachable from the root set. -reachable roots store = go roots mempty - where go set seen = case liveSplit set of +reachable roots store = go mempty roots + where go seen set = case liveSplit set of Nothing -> seen Just (a, as) - | Just values <- storeLookupAll a store -> go (liveDifference (foldr ((<>) . valueRoots) mempty values <> as) seen) (liveInsert a seen) - | otherwise -> go seen (liveInsert a seen) + | Just values <- storeLookupAll a store -> go (liveInsert a seen) (liveDifference (foldr ((<>) . valueRoots) mempty values <> as) seen) + | otherwise -> go (liveInsert a seen) seen