[pypy-commit] pypy default: test and fix

arigo noreply at buildbot.pypy.org
Sat Dec 10 00:09:56 CET 2011


Author: Armin Rigo <arigo at tunes.org>
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


More information about the pypy-commit mailing list