Fix gdb/libpython.py for not ready Unicode strings

_PyUnicode_CheckConsistency() checks also hash and length value for not ready
Unicode strings.
This commit is contained in:
Victor Stinner 2011-11-04 20:54:05 +01:00
parent 2fc507fe45
commit e30c0a1014
3 changed files with 10 additions and 10 deletions

View file

@ -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