[pypy-svn] r33956 - pypy/dist/pypy/jit/timeshifter

rxe at codespeak.net rxe at codespeak.net
Tue Oct 31 15:18:52 CET 2006


Author: rxe
Date: Tue Oct 31 15:18:50 2006
New Revision: 33956

Modified:
   pypy/dist/pypy/jit/timeshifter/rtyper.py
Log:
cast pointer to address, so we can hash it.  (arigo, pedronis around, rxe)

Modified: pypy/dist/pypy/jit/timeshifter/rtyper.py
==============================================================================
--- pypy/dist/pypy/jit/timeshifter/rtyper.py	(original)
+++ pypy/dist/pypy/jit/timeshifter/rtyper.py	Tue Oct 31 15:18:50 2006
@@ -208,7 +208,10 @@
             key = ()
             for color in argcolors:
                 if color == "green":
-                    key = key + (args[i],)
+                    x = args[i]
+                    if isinstance(lltype.typeOf(x), lltype.Ptr): 
+                        x = llmemory.cast_ptr_to_adr(x)
+                    key = key + (x,)
                 i = i + 1
             cache = state.cache
             try:
@@ -222,7 +225,10 @@
             residualargs = ()
             for color in argcolors:
                 if color == "green":
-                    key = key + (args[i],)
+                    x = args[i]
+                    if isinstance(lltype.typeOf(x), lltype.Ptr): 
+                        x = llmemory.cast_ptr_to_adr(x)
+                    key = key + (x,)
                 else:
                     residualargs = residualargs + (args[i],)
                 i = i + 1



More information about the Pypy-commit mailing list