diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2012-03-04 01:34:37 +0100 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2012-03-04 01:34:37 +0100 |
| commit | c9590ad745caa9fc76a8373d19e8019d90e8f9e8 (patch) | |
| tree | f4ef97eba8cadeb127abe6f63d6ec0bf5e3b3196 /Include | |
| parent | d263d185534a8c19b719f27f5dab757afbc9319e (diff) | |
| download | cpython-git-c9590ad745caa9fc76a8373d19e8019d90e8f9e8.tar.gz | |
Close #14085: remove assertions from PyUnicode_WRITE macro
Add checks in PyUnicode_WriteChar() and convert PyUnicode_New() assertion to a
test raising a Python exception.
Diffstat (limited to 'Include')
| -rw-r--r-- | Include/unicodeobject.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 465d87b6f2..8f74995093 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -499,17 +499,14 @@ 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); \ } \ |
