Serhiy Storchaka added the comment:
- if (dictresize(mp, Py_SIZE(seq))) {
+ if (dictresize(mp, Py_SIZE(seq) / 2 * 3)) {
If Py_SIZE(seq) is 1, dictresize argument is 0.
Why not wryte the expression as Py_SIZE(seq) * 3 / 2? It never overflows,
because Py_SIZE(seq) is the size of allocated array of pointers.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue23971>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com