summaryrefslogtreecommitdiffstats
path: root/Python/structmember.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/structmember.c')
-rw-r--r--Python/structmember.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/Python/structmember.c b/Python/structmember.c
index 1b8be28..19a7522 100644
--- a/Python/structmember.c
+++ b/Python/structmember.c
@@ -8,6 +8,12 @@ PyObject *
PyMember_GetOne(const char *obj_addr, PyMemberDef *l)
{
PyObject *v;
+ if (l->flags & Py_RELATIVE_OFFSET) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "PyMember_GetOne used with Py_RELATIVE_OFFSET");
+ return NULL;
+ }
const char* addr = obj_addr + l->offset;
switch (l->type) {
@@ -103,6 +109,12 @@ int
PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v)
{
PyObject *oldv;
+ if (l->flags & Py_RELATIVE_OFFSET) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "PyMember_SetOne used with Py_RELATIVE_OFFSET");
+ return -1;
+ }
addr += l->offset;