[pypy-svn] r62878 - in pypy/branch/pyjitpl5/pypy/jit: backend/x86 metainterp

arigo at codespeak.net arigo at codespeak.net
Thu Mar 12 12:20:53 CET 2009


Author: arigo
Date: Thu Mar 12 12:20:50 2009
New Revision: 62878

Modified:
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/runner.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/history.py
Log:
getint() should return an int.  Improve the previous fix.


Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/runner.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/runner.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/runner.py	Thu Mar 12 12:20:50 2009
@@ -439,7 +439,7 @@
         elif size == WORD:
             a = rffi.cast(rffi.CArrayPtr(lltype.Signed), gcref)
             if not ptr:
-                a[ofs/WORD + field] = int(args[2].getint())
+                a[ofs/WORD + field] = args[2].getint()
             else:
                 p = args[2].getptr(llmemory.GCREF)
                 a[ofs/WORD + field] = self.cast_gcref_to_int(p)

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/history.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/history.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/history.py	Thu Mar 12 12:20:50 2009
@@ -125,7 +125,10 @@
 
     def __init__(self, value):
         if not we_are_translated():
-            assert isinstance(value, (int, ComputedIntSymbolic))
+            if isinstance(value, int):
+                value = int(value)    # bool -> int
+            else:
+                assert isinstance(value, ComputedIntSymbolic)
         self.value = value
 
     def clonebox(self):
@@ -251,7 +254,10 @@
 
     def __init__(self, value=0):
         if not we_are_translated():
-            assert isinstance(value, (int, ComputedIntSymbolic))
+            if isinstance(value, int):
+                value = int(value)    # bool -> int
+            else:
+                assert isinstance(value, ComputedIntSymbolic)
         self.value = value
 
     def clonebox(self):



More information about the Pypy-commit mailing list