diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-04 19:54:05 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-04 19:54:05 (GMT) |
commit | e30c0a1014fb8f7978f608d6c7f430842f685075 (patch) | |
tree | 09eb1d83e739f2508f81e5ddc5739ddefa001957 /Objects | |
parent | 2fc507fe45e4e3cf4f332ff496a4aed9adf345d1 (diff) | |
download | cpython-e30c0a1014fb8f7978f608d6c7f430842f685075.zip cpython-e30c0a1014fb8f7978f608d6c7f430842f685075.tar.gz cpython-e30c0a1014fb8f7978f608d6c7f430842f685075.tar.bz2 |
Fix gdb/libpython.py for not ready Unicode strings
_PyUnicode_CheckConsistency() checks also hash and length value for not ready
Unicode strings.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/unicodeobject.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index fa6563b..ef9bb03 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -328,18 +328,21 @@ _PyUnicode_CheckConsistency(PyObject *op, int check_content) assert(ascii->state.ascii == 0); assert(ascii->state.ready == 1); assert (compact->utf8 != data); - } else { + } + else { PyUnicodeObject *unicode = (PyUnicodeObject *)op; data = unicode->data.any; if (kind == PyUnicode_WCHAR_KIND) { + assert(ascii->length == 0); + assert(ascii->hash == -1); assert(ascii->state.compact == 0); assert(ascii->state.ascii == 0); assert(ascii->state.ready == 0); + assert(ascii->state.interned == SSTATE_NOT_INTERNED); assert(ascii->wstr != NULL); assert(data == NULL); assert(compact->utf8 == NULL); - assert(ascii->state.interned == SSTATE_NOT_INTERNED); } else { assert(kind == PyUnicode_1BYTE_KIND |