Author: Armin Rigo <[email protected]>
Branch: stmgc-c7
Changeset: r70210:93660d35aeb4
Date: 2014-03-23 16:39 +0100
http://bitbucket.org/pypy/pypy/changeset/93660d35aeb4/

Log:    test (locally in the source) and fix

diff --git a/rpython/jit/backend/x86/regloc.py 
b/rpython/jit/backend/x86/regloc.py
--- a/rpython/jit/backend/x86/regloc.py
+++ b/rpython/jit/backend/x86/regloc.py
@@ -481,11 +481,11 @@
                             val1 = getattr(loc1, "value_" + possible_code1)()
                             # More faking out of certain operations for x86_64
                             fits32 = rx86.fits_in_32bits
-                            if possible_code1 == 'j' and not fits32(val1):
+                            if possible_code1 == 'j' and not fits32(val1[1]):
                                 val1 = self._addr_as_reg_offset(val1)
                                 invoke(self, "m" + possible_code2, val1, val2)
                                 return
-                            if possible_code2 == 'j' and not fits32(val2):
+                            if possible_code2 == 'j' and not fits32(val2[1]):
                                 val2 = self._addr_as_reg_offset(val2)
                                 invoke(self, possible_code1 + "m", val1, val2)
                                 return
@@ -515,7 +515,7 @@
                         self._load_scratch(val)    # for 'PUSH(imm)'
                         _rx86_getattr(self, name + 
"_r")(X86_64_SCRATCH_REG.value)
                         return
-                    if possible_code == 'j' and not fits32(val):
+                    if possible_code == 'j' and not fits32(val[1]):
                         val = self._addr_as_reg_offset(val)
                         _rx86_getattr(self, name + "_m")(val)
                         return
diff --git a/rpython/jit/backend/x86/rx86.py b/rpython/jit/backend/x86/rx86.py
--- a/rpython/jit/backend/x86/rx86.py
+++ b/rpython/jit/backend/x86/rx86.py
@@ -47,6 +47,7 @@
     return -128 <= value < 128
 
 def fits_in_32bits(value):
+    value + 0    # check that it's an integer; crashes if we receive a tuple
     return -2147483648 <= value <= 2147483647
 
 SEGMENT_NO = '\x00'
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to