mirror of https://github.com/python/cpython
bpo-40881: Fix unicode_release_interned() (GH-20699)
Use Py_SET_REFCNT() in unicode_release_interned().
This commit is contained in:
parent
7907f8cbc6
commit
c96a61e816
|
@ -15669,13 +15669,13 @@ unicode_release_interned(void)
|
|||
}
|
||||
switch (PyUnicode_CHECK_INTERNED(s)) {
|
||||
case SSTATE_INTERNED_IMMORTAL:
|
||||
Py_REFCNT(s) += 1;
|
||||
Py_SET_REFCNT(s, Py_REFCNT(s) + 1);
|
||||
#ifdef INTERNED_STATS
|
||||
immortal_size += PyUnicode_GET_LENGTH(s);
|
||||
#endif
|
||||
break;
|
||||
case SSTATE_INTERNED_MORTAL:
|
||||
Py_REFCNT(s) += 2;
|
||||
Py_SET_REFCNT(s, Py_REFCNT(s) + 2);
|
||||
#ifdef INTERNED_STATS
|
||||
mortal_size += PyUnicode_GET_LENGTH(s);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue