From 0fda08b36ea6080a99185d4eef5e41d9fc877ed3 Mon Sep 17 00:00:00 2001 From: Vidar Holen <spam@vidarholen.net> Date: Mon, 5 Nov 2012 10:24:52 -0800 Subject: [PATCH] Fixed missing Alive detection in current scope --- Shpell/Analytics.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Shpell/Analytics.hs b/Shpell/Analytics.hs index 3e5b6b1..eeb7a4f 100644 --- a/Shpell/Analytics.hs +++ b/Shpell/Analytics.hs @@ -242,7 +242,8 @@ getVariableFlow t = findSubshelled :: [StackData] -> [[(Id,String)]] -> (Map.Map String VariableState) -> State (Map.Map Id Metadata) () findSubshelled [] _ _ = return () -findSubshelled ((Assignment x):rest) (scope:lol) deadVars = findSubshelled rest ((x:scope):lol) deadVars +findSubshelled ((Assignment x@(id, str)):rest) (scope:lol) deadVars = + findSubshelled rest ((x:scope):lol) $ Map.insert str Alive deadVars findSubshelled ((Reference (readId, str)):rest) scopes deadVars = do case Map.findWithDefault Alive str deadVars of Alive -> return ()