| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
Fix multiplying a list by an integer (list *= int): detect the
integer overflow when the new allocated length is close to the
maximum size. Issue reported by Jordan Limor.
list_resize() now checks for integer overflow before multiplying the
new allocated length by the list item size (sizeof(PyObject*)).
(cherry picked from commit a5f092f3c469b674b8d9ccbd4e4377230c9ac7cf)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
| |
|
|
|
|
|
| |
(GH-18204)
(cherry picked from commit f64abd10563c25a94011f9e3335fd8a1cf47c205)
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
https://bugs.python.org/issue39425
Automerge-Triggered-By: @pablogsal
(cherry picked from commit 14d80d0b605d8b148e14458e4c1853a940071462)
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-17765)
* [3.7] bpo-38588: Fix possible crashes in dict and list when calling PyObject_RichCompareBool (GH-17734)
Take strong references before calling PyObject_RichCompareBool to protect against the case
where the object dies during the call..
(cherry picked from commit 2d5bf568eaa5059402ccce9ba5a366986ba27c8a)
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* methane's suggestion
methane's suggestion
Co-Authored-By: Inada Naoki <songofacandy@gmail.com>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
(GH-17759)
Hold strong references to list elements while calling PyObject_RichCompareBool()..
(cherry picked from commit d9e561d23d994e3ed15f4fcbd7ee5c8fe50f190b)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
|
| |
This is a complement to PR 13375.
(cherry picked from commit 3c87a667bb367ace1de6bd1577fdb4f66947da52)
Co-authored-by: HongWeipeng <hongweichen8888@sina.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-10202)
…nctions with asserts
The actual overflow can never happen because of the following:
* The size of a list can't be greater than PY_SSIZE_T_MAX / sizeof(PyObject*).
* The size of a pointer on all supported plaftorms is at least 4 bytes.
* ofs is positive and less than the list size at the beginning of each iteration.
https://bugs.python.org/issue35091
(cherry picked from commit 6bc5917903b722bdd0e5d3020949f26fec5dfe9a)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
| |
|
|
|
|
|
| |
GH-12532)
(cherry picked from commit dd5417afcf8924bcdd7077351941ad21727ef644)
Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
|
| |
|
|
|
|
|
| |
list_sort_impl(). (GH-8710)
(cherry picked from commit ebc793d6acb9650b9f497808e059805892031d74)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
|
|
|
| |
There is already a `Py_ssize_t i` defined at function scope that is used
for similar loops. By removing the local `int i` declaration that `i` is
used, which has the appropriate type.
(cherry picked from commit f8b534477a2a51d85ea1663530f685f805f2b247)
Co-authored-by: sth <sth.dev@tejp.de>
|
| |
|
|
|
| |
(cherry picked from commit 745dc65b17b3936e3f9f4099f735f174d30c4e0c)
Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
|
| | |
|
| |
|
|
| |
(#582)
|
| |
|
|
|
| |
instead of crashing due to a stack overflow.
This perhaps will fix similar problems in other extension types.
|
| |
|
|
|
|
| |
Py_Main() now handles two more -X options:
* -X showrefcount: new _PyCoreConfig.show_ref_count field
* -X showalloccount: new _PyCoreConfig.show_alloc_count field
|
| |
|
|
| |
functions (GH-793)
|
| |
|
|
|
|
|
| |
* group the (stateful) runtime globals into various topical structs
* consolidate the topical structs under a single top-level _PyRuntimeState struct
* add a check-c-globals.py script that helps identify runtime globals
Other globals are excluded (see globals.txt and check-c-globals.py).
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
and tuple(). (#518)
|
| |
|
|
| |
int(), bool(), float(), list() and tuple(). Specify the value as a
positional argument instead.
|
| | |
|
| |
|
|
| |
possible. Patch is writen with Coccinelle.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like
_PyObject_CallArg1() uses more stack memory than
PyObject_CallFunctionObjArgs().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func)
* PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg)
PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires
extra work to "parse" C arguments to build a C array of PyObject*.
_PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate
memory on the C stack.
This change is part of the fastcall project. The change on listsort() is
related to the issue #23507.
|
| | |
|
| |\ |
|
| | | |
|
| | |
| |
| |
| | |
by Xiang Zhang.
|
| | |
| |
| |
| | |
Patch by Xiang Zhang.
|
| | |
| |
| |
| |
| |
| | |
SHOW_ALLOC_COUNT or SHOW_TRACK_COUNT macros is now off by default. It can
be re-enabled using the "-X showalloccount" option. It now outputs to stderr
instead of stdout.
|
| |\ \
| |/
| |
| | |
in places where Py_DECREF was used.
|
| |\ \
| |/ |
|
| |\ \
| |/
| |
| |
| |
| | |
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
|
| | |
| |
| |
| |
| |
| | |
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
|
| | | |
|
| |/
|
|
|
| |
Old code is correct, but with Py_SETREF and Py_CLEAR it can be cleaner.
This patch doesn't fix bugs and hence there is no need to backport it.
|
| |
|
|
|
| |
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
|
| |\ |
|
| | |\ |
|
| | | |\ |
|
| | | | |
| | | |
| | | |
| | | | |
Patch by Christian Heimes.
|
| |\ \ \ \
| |/ / / |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
#23515)
See
de Gouw, Stijn and Rot, Jurriaan and de Boer, Frank S and Bubel, Richard and Hähnle, Reiner
"OpenJDK’s java.utils.Collection.sort() is broken: The good, the bad and the worst case"
|
| |/ / /
| | |
| | |
| | |
| | | |
tuples by adding 'or slices'. Added ', not <typename' for bytearrays.
Original patch by Claudiu Popa.
|
| |\ \ \
| |/ / |
|