diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2020-03-09 18:49:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-09 18:49:52 (GMT) |
commit | eebaa9bfc593d5a46b293c1abd929fbfbfd28199 (patch) | |
tree | 9ba0bbaba8116eb71d0b80f11b586fe063aadbe5 /Objects | |
parent | 6d0ee60740f2862a878f009671b1aaa75aeb0c2a (diff) | |
download | cpython-eebaa9bfc593d5a46b293c1abd929fbfbfd28199.zip cpython-eebaa9bfc593d5a46b293c1abd929fbfbfd28199.tar.gz cpython-eebaa9bfc593d5a46b293c1abd929fbfbfd28199.tar.bz2 |
bpo-38249: Expand Py_UNREACHABLE() to __builtin_unreachable() in the release mode. (GH-16329)
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/stringlib/eq.h | 9 |
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) |