changeset 132:4e2a22493116

flow: Fixed major error in the work-list implementation Before we only added the first statement to the worklist, so if at some statement in a body no changes where made, the values of that statement would not be propagated further. Now all statements are entered from the beginning.
author Sigurd Meldgaard <stm@daimi.au.dk>
date Mon, 02 Nov 2009 11:33:30 +0100
parents 8f4dbf37a96f
children 5252a8c52011
files pysmcl/flow.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/flow.py	Thu Oct 29 16:58:48 2009 +0100
+++ b/pysmcl/flow.py	Mon Nov 02 11:33:30 2009 +0100
@@ -26,7 +26,7 @@
     worklist = []
 
     Flow().flow(function)
-    worklist.append(function)
+    worklist+=[i for i in ast.walk(function) if isinstance(i,ast.stmt)]
 
     # main cycle
     while len(worklist) != 0: