From 24e6e35e828d869e30266f22fab9020c26b8fc36 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 29 Jan 2008 12:49:16 +0000 Subject: [PATCH] Corrected the checkInitVar function to work properly --- checks/Check.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/checks/Check.hs b/checks/Check.hs index d82c276..e1da961 100644 --- a/checks/Check.hs +++ b/checks/Check.hs @@ -130,8 +130,7 @@ showCodeExSet (NormalSet s) -- | Checks that no variable is used uninitialised. That is, it checks that every variable is written to before it is read. checkInitVar :: forall m. (Monad m, Die m, CSM m) => Meta -> FlowGraph m (Maybe Decl, Vars) -> Node -> m () checkInitVar m graph startNode - -- TODO don't pass in all the nodes from the graph, just those connected to startNode - = do vwb <- case flowAlgorithm graphFuncs (nodes graph) startNode of + = do vwb <- case flowAlgorithm graphFuncs (dfs [startNode] graph) startNode of Left err -> dieP m $ "Error building control-flow graph: " ++ err Right x -> return x -- vwb is a map from Node to a set of Vars that have been written by that point