Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r50333:94737f156c30
Date: 2011-12-09 23:04 +0100
http://bitbucket.org/pypy/pypy/changeset/94737f156c30/

Log:    test and fix

diff --git a/pypy/jit/backend/llsupport/regalloc.py 
b/pypy/jit/backend/llsupport/regalloc.py
--- a/pypy/jit/backend/llsupport/regalloc.py
+++ b/pypy/jit/backend/llsupport/regalloc.py
@@ -69,7 +69,7 @@
         self.bindings[box] = loc
         #
         index = self.get_loc_index(loc)
-        endindex = index + self.frame_size(box)
+        endindex = index + self.frame_size(box.type)
         while len(self.used) < endindex:
             self.used.append(False)
         while index < endindex:
diff --git a/pypy/jit/backend/llsupport/test/test_regalloc.py 
b/pypy/jit/backend/llsupport/test/test_regalloc.py
--- a/pypy/jit/backend/llsupport/test/test_regalloc.py
+++ b/pypy/jit/backend/llsupport/test/test_regalloc.py
@@ -42,8 +42,10 @@
     def frame_size(self, box_type):
         if box_type == FLOAT:
             return 2
+        elif box_type == INT:
+            return 1
         else:
-            return 1
+            raise ValueError(box_type)
     def get_loc_index(self, loc):
         assert isinstance(loc, FakeFramePos)
         return loc.pos
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to