10000 gh-120198: Fix crash when two thread edit __class__ by Fidget-Spinner · Pull Request #120195 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-120198: Fix crash when two thread edit __class__ #120195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 11, 2024
Prev Previous commit
Next Next commit
Remove heap type flags
  • Loading branch information
Fidget-Spinner committed Jun 7, 2024
commit b1dc75bb2220c72f3ad0a5fad4eb87cfe2e74ad7
6 changes: 0 additions & 6 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -6573,13 +6573,7 @@ object_set_class(PyObject *self, PyObject *value, void *closure)
return -1;
}
}
if (newto->tp_flags & Py_TPFLAGS_HEAPTYPE) {
Py_INCREF(newto);
}
Py_SET_TYPE(self, newto);
if (oldto->tp_flags & Py_TPFLAGS_HEAPTYPE)
Py_DECREF(oldto);

RARE_EVENT_INC(set_class);
return 0;
}
Expand Down
0