summaryrefslogtreecommitdiffstats
path: root/Objects/stringlib/eq.h
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/stringlib/eq.h')
-rw-r--r--Objects/stringlib/eq.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/Objects/stringlib/eq.h b/Objects/stringlib/eq.h
index ff22f91..9c1058b 100644
--- a/Objects/stringlib/eq.h
+++ b/Objects/stringlib/eq.h
@@ -6,13 +6,14 @@
Py_LOCAL_INLINE(int)
unicode_eq(PyObject *aa, PyObject *bb)
{
+ assert(PyUnicode_Check(aa));
+ assert(PyUnicode_Check(bb));
+ assert(PyUnicode_IS_READY(aa));
+ assert(PyUnicode_IS_READY(bb));
+
PyUnicodeObject *a = (PyUnicodeObject *)aa;
PyUnicodeObject *b = (PyUnicodeObject *)bb;
- if (PyUnicode_READY(a) == -1 || PyUnicode_READY(b) == -1) {
- Py_UNREACHABLE();
- }
-
if (PyUnicode_GET_LENGTH(a) != PyUnicode_GET_LENGTH(b))
return 0;
if (PyUnicode_GET_LENGTH(a) == 0)