Skip to content

Commit a4eb936

Browse files
authored
gh-157892: Fix error check on _Py_hashtable_set() in intern_static() (#157898)
_Py_hashtable_set() returns -1 on failure, so the "< -1" check could never be true and the Py_FatalError() call was unreachable.
1 parent b6f9a50 commit a4eb936

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
@@ -14588,7 +14588,7 @@ intern_static(PyInterpreterState *interp, PyObject *s /* stolen */)
1458814588
return Py_NewRef(r);
1458914589
}
1459014590

14591-
if (_Py_hashtable_set(INTERNED_STRINGS, s, s) < -1) {
14591+
if (_Py_hashtable_set(INTERNED_STRINGS, s, s) < 0) {
1459214592
Py_FatalError("failed to intern static string");
1459314593
}
1459414594

0 commit comments

Comments
 (0)