Author: Armin Rigo <[email protected]>
Branch:
Changeset: r79640:b4ab9fb41dcd
Date: 2015-09-14 19:49 +0200
http://bitbucket.org/pypy/pypy/changeset/b4ab9fb41dcd/
Log: Hack for zero_ptr_field
diff --git a/rpython/jit/backend/test/test_random.py
b/rpython/jit/backend/test/test_random.py
--- a/rpython/jit/backend/test/test_random.py
+++ b/rpython/jit/backend/test/test_random.py
@@ -61,6 +61,13 @@
if result is not None:
c_result = wrap_constant(result)
op.copy_value_from(c_result)
+ else:
+ import ctypes
+ addr = self.cpu.cast_gcref_to_int(argboxes[0].getref_base())
+ offset = argboxes[1].getint()
+ assert (offset % ctypes.sizeof(ctypes.c_long)) == 0
+ ptr = ctypes.cast(addr, ctypes.POINTER(ctypes.c_long))
+ ptr[offset / ctypes.sizeof(ctypes.c_long)] = 0
self.loop.operations.append(op)
return op
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit