bpo-31393: Fix the use of PyUnicode_READY(). (#3451)

This commit is contained in:
Serhiy Storchaka 2017-09-08 09:58:51 +03:00 committed by GitHub
parent 70c2dd306f
commit e3b2b4b8d9
5 changed files with 30 additions and 14 deletions

View file

@ -30,9 +30,9 @@ class object "PyObject *" "&PyBaseObject_Type"
#define MCACHE_HASH_METHOD(type, name) \
MCACHE_HASH((type)->tp_version_tag, \
((PyASCIIObject *)(name))->hash)
#define MCACHE_CACHEABLE_NAME(name) \
PyUnicode_CheckExact(name) && \
PyUnicode_READY(name) != -1 && \
#define MCACHE_CACHEABLE_NAME(name) \
PyUnicode_CheckExact(name) && \
PyUnicode_IS_READY(name) && \
PyUnicode_GET_LENGTH(name) <= MCACHE_MAX_ATTR_SIZE
struct method_cache_entry {