Skip to content

Commit 72c85c6

Browse files
miss-islingtonrishiraj38eendebakpt
authored
[3.14] gh-157892: Fix error check on _Py_hashtable_set() in intern_static() (GH-157898) (#158300)
gh-157892: Fix error check on _Py_hashtable_set() in intern_static() (GH-157898) _Py_hashtable_set() returns -1 on failure, so the "< -1" check could never be true and the Py_FatalError() call was unreachable. (cherry picked from commit a4eb936) Co-authored-by: Rishi Raj <180109771+rishiraj38@users.noreply.github.com> Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
1 parent b9edf9b commit 72c85c6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Objects/unicodeobject.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15947,7 +15947,7 @@ intern_static(PyInterpreterState *interp, PyObject *s /* stolen */)
1594715947
return Py_NewRef(r);
1594815948
}
1594915949

15950-
if (_Py_hashtable_set(INTERNED_STRINGS, s, s) < -1) {
15950+
if (_Py_hashtable_set(INTERNED_STRINGS, s, s) < 0) {
1595115951
Py_FatalError("failed to intern static string");
1595215952
}
1595315953

0 commit comments

Comments
 (0)