changeset 63:b60bb8512736

The flow is now flowing into an if statement and from there into its branches and any following statements.
author Janus Dam Nielsen <janus.nielsen@alexandra.dk>
date Wed, 27 May 2009 11:52:28 +0200
parents f5f904ab0f46
children c7d03c2e6e29
files pysmcl/flow.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/flow.py	Wed May 27 11:51:17 2009 +0200
+++ b/pysmcl/flow.py	Wed May 27 11:52:28 2009 +0200
@@ -72,8 +72,8 @@
         for stm in body:
             self.make_edge(current, stm)
             if isinstance(stm, ast.If):
-                out_of_then = self.flow_body(stm.body, current)
-                out_of_else = self.flow_body(stm.orelse, current)
+                out_of_then = self.flow_body(stm.body, set([stm]))
+                out_of_else = self.flow_body(stm.orelse, set([stm]))
                 current = out_of_then | out_of_else
             elif isinstance(stm, ast.While):
                 # TODO, does not express the condition being evaluated twice