Message133726
Ezio Melotti wrote:
>
> Ezio Melotti <ezio.melotti@gmail.com> added the comment:
>
> The attached patch skips the peepholer optimizations for BINARY_SUBSCR if the resulting char is a surrogate on narrow builds or a non-bmp char in wide builds.
> Note that this affects the optimization of lone surrogates on narrow builds too, but I think it's not worth to adding more complexity on the peepholer and check if they are part of a surrogate pair.
> The patch still lacks comments and could have better tests.
newconst = PyObject_GetItem(v, w);
+ if (PyUnicode_Check(v)) {
+ Py_UNICODE ch = PyUnicode_AS_UNICODE(newconst)[0];
Without checking, you shouldn't assume that newconst is a PyUnicodeObject.
Other than that the patch looks fine. |
|
Date |
User |
Action |
Args |
2011-04-14 11:48:49 | lemburg | set | recipients:
+ lemburg, rhettinger, amaury.forgeotdarc, pitrou, ezio.melotti |
2011-04-14 11:48:48 | lemburg | link | issue5057 messages |
2011-04-14 11:48:48 | lemburg | create | |
|