From ae7557d623ab47d9363a7ce209b407b23e97ba24 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 20 Nov 2008 15:39:28 +0000 Subject: [PATCH] Corrected a bug in varsTouchedAfter that was related to flowAlgorithm and was causing the odd bug in checkUnusedVar --- checks/CheckFramework.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/checks/CheckFramework.hs b/checks/CheckFramework.hs index 546cbbc..8cd8d99 100644 --- a/checks/CheckFramework.hs +++ b/checks/CheckFramework.hs @@ -410,13 +410,13 @@ varsTouchedAfter = FlowGraphAnalysis iterate :: FlowGraph CheckOptM UsageLabel -> (Node, EdgeLabel) -> Set.Set Var -> Maybe (Set.Set Var) -> Set.Set Var - iterate g node prevVars maybeVars = case lab g (fst node) of + iterate g node varsForPrevNode maybeVars = case lab g (fst node) of Just ul -> let vs = nodeVars $ getNodeData ul readFromVars = readVars vs writtenToVars = writtenVars vs - addTo = fromMaybe prevVars maybeVars - in (readFromVars `Set.union` addTo) `Set.union` Map.keysSet writtenToVars + addTo = fromMaybe Set.empty maybeVars + in foldl Set.union addTo [varsForPrevNode, readFromVars, Map.keysSet writtenToVars] Nothing -> error "Node label not found in calculateUsedAgainAfter"