mirror of
https://github.com/python/cpython.git
synced 2025-10-01 12:52:18 +00:00
[3.14] gh-133891: Add missing error check to SET_COUNT
macro in _testinternalcapi.c
(GH-133892) (#134988)
gh-133891: Add missing error check to `SET_COUNT` macro in `_testinternalcapi.c` (GH-133892)
(cherry picked from commit cebae977a6
)
Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
parent
890607fa05
commit
a8708f7320
1 changed files with 3 additions and 0 deletions
|
@ -1045,6 +1045,9 @@ get_code_var_counts(PyObject *self, PyObject *_args, PyObject *_kwargs)
|
|||
#define SET_COUNT(DICT, STRUCT, NAME) \
|
||||
do { \
|
||||
PyObject *count = PyLong_FromLong(STRUCT.NAME); \
|
||||
if (count == NULL) { \
|
||||
goto error; \
|
||||
} \
|
||||
int res = PyDict_SetItemString(DICT, #NAME, count); \
|
||||
Py_DECREF(count); \
|
||||
if (res < 0) { \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue