diff options
Diffstat (limited to 'Include/unicodeobject.h')
-rw-r--r-- | Include/unicodeobject.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index c706fc2..6d580f4 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -499,14 +499,17 @@ enum PyUnicode_Kind { do { \ switch ((kind)) { \ case PyUnicode_1BYTE_KIND: { \ + assert(value <= 0xff); \ ((Py_UCS1 *)(data))[(index)] = (Py_UCS1)(value); \ break; \ } \ case PyUnicode_2BYTE_KIND: { \ + assert(value <= 0xffff); \ ((Py_UCS2 *)(data))[(index)] = (Py_UCS2)(value); \ break; \ } \ default: { \ + assert(value <= 0x10ffff); \ assert((kind) == PyUnicode_4BYTE_KIND); \ ((Py_UCS4 *)(data))[(index)] = (Py_UCS4)(value); \ } \ |