Author: Edd Barrett <[email protected]>
Branch: asmmemmgr-for-code-only
Changeset: r86840:42b309a4db14
Date: 2016-09-02 16:14 +0100
http://bitbucket.org/pypy/pypy/changeset/42b309a4db14/
Log: Mark an argument we send to a C-callback as writable.
diff --git a/rpython/rlib/clibffi.py b/rpython/rlib/clibffi.py
--- a/rpython/rlib/clibffi.py
+++ b/rpython/rlib/clibffi.py
@@ -540,9 +540,14 @@
track_allocation=False)
self.ll_userdata.callback = rffi.llhelper(CALLBACK_TP, func)
self.ll_userdata.addarg = additional_arg
+
+ ll_closure_p = rffi.cast(rffi.CCHARP, self.ll_closure)
+ set_pages_writable(ll_closure_p, CHUNK)
res = c_ffi_prep_closure(self.ll_closure, self.ll_cif,
ll_callback, rffi.cast(rffi.VOIDP,
self.ll_userdata))
+ set_pages_executable(ll_closure_p, CHUNK)
+
if not res == FFI_OK:
raise LibFFIError
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit