Commit 09792502 authored by Boxiang Sun's avatar Boxiang Sun

Use PyMethod_GET_SELF instead access the PyMethodObject field directly

Pyston use PyMethodObject as an opaque pointer. So we should not access its
member directly.
parent f7f98754
......@@ -208,8 +208,10 @@ static PyExtensionClass NAME ## Type = { PyObject_HEAD_INIT(NULL) 0, # NAME, \
PyExtensionClassCAPI->PyECMethod_New_((CALLABLE),(INST))
/* Return the instance that is bound by an extension class method. */
// Pyston change:
#define PyECMethod_Self(M) \
(PyMethod_Check((M)) ? ((PyMethodObject*)(M))->im_self : NULL)
(PyMethod_Check((M)) ? PyMethod_GET_SELF(M) : NULL)
// (PyMethod_Check((M)) ? ((PyMethodObject*)(M))->im_self : NULL)
/* Check whether an object has an __of__ method for returning itself
in the context of it's container. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment