Permalink
Browse files

reg_allocator: fix bug in alloc

when all the variables we come accross are
non-interfering, we assign them ebx immediately
so sometime there is nothing to allocate at the
bottom of the while loop
  • Loading branch information...
1 parent 5f85ecd commit 622be0b4cf5f5d5e5804400d6c80a6e4b4aaebed @cantora committed Sep 26, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 pyc_reg_allocator.py
View
@@ -109,6 +109,9 @@ def alloc(live_list, graph, symtbl):
constraints[node].add(n_loc)
todo = todo - no_intf
+ if len(constraints) < 1:
+ continue
+
sorted_nodes = sorted(constraints.keys(), key = lambda k: len(graph[k]), reverse = True)
log("allocate memory for %s" % repr(sorted_nodes[0]) )
i = 0

0 comments on commit 622be0b

Please sign in to comment.