[pypy-svn] r65556 - in pypy/branch/pyjitpl5-experiments/pypy: jit/backend/x86 rlib

arigo at codespeak.net arigo at codespeak.net
Wed Jun 3 15:24:50 CEST 2009


Author: arigo
Date: Wed Jun  3 15:24:49 2009
New Revision: 65556

Modified:
   pypy/branch/pyjitpl5-experiments/pypy/jit/backend/x86/regalloc.py
   pypy/branch/pyjitpl5-experiments/pypy/rlib/rgc.py
Log:
Don't call rgc.can_move() on null pointers.


Modified: pypy/branch/pyjitpl5-experiments/pypy/jit/backend/x86/regalloc.py
==============================================================================
--- pypy/branch/pyjitpl5-experiments/pypy/jit/backend/x86/regalloc.py	(original)
+++ pypy/branch/pyjitpl5-experiments/pypy/jit/backend/x86/regalloc.py	Wed Jun  3 15:24:49 2009
@@ -45,7 +45,7 @@
     if isinstance(c, ConstInt):
         return imm(c.value)
     elif isinstance(c, ConstPtr):
-        if we_are_translated() and rgc.can_move(c.value):
+        if we_are_translated() and c.value and rgc.can_move(c.value):
             print "convert_to_imm: ConstPtr needs special care"
             raise AssertionError
         return imm(rffi.cast(lltype.Signed, c.value))

Modified: pypy/branch/pyjitpl5-experiments/pypy/rlib/rgc.py
==============================================================================
--- pypy/branch/pyjitpl5-experiments/pypy/rlib/rgc.py	(original)
+++ pypy/branch/pyjitpl5-experiments/pypy/rlib/rgc.py	Wed Jun  3 15:24:49 2009
@@ -165,7 +165,7 @@
         return hop.genop('gc_set_max_heap_size', [v_nbytes],
                          resulttype=lltype.Void)
 
-def can_move(p):
+def can_move(p):    # NB. must not be called with NULL pointers
     return True
 
 class CanMoveEntry(ExtRegistryEntry):



More information about the Pypy-commit mailing list