We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
PyMember_GetOne
_Py_T_OBJECT
1 parent e77d678 commit 7fd708bCopy full SHA for 7fd708b
Python/structmember.c
@@ -85,10 +85,22 @@ PyMember_GetOne(const char *obj_addr, PyMemberDef *l)
85
break;
86
}
87
case _Py_T_OBJECT:
88
- v = *(PyObject **)addr;
89
- if (v == NULL)
+ v = FT_ATOMIC_LOAD_PTR(*(PyObject **) addr);
+ if (v != NULL) {
90
+#ifdef Py_GIL_DISABLED
91
+ if (!_Py_TryIncrefCompare((PyObject **) addr, v)) {
92
+ Py_BEGIN_CRITICAL_SECTION((PyObject *) obj_addr);
93
94
+ Py_XINCREF(v);
95
+ Py_END_CRITICAL_SECTION();
96
+ }
97
+#else
98
+ Py_INCREF(v);
99
+#endif
100
101
+ if (v == NULL) {
102
v = Py_None;
- Py_INCREF(v);
103
104
105
case Py_T_OBJECT_EX:
106
v = member_get_object(addr, obj_addr, l);
0 commit comments