mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Jack Jansen on python-dev. Add simple test case. Move vereq() from test_descr to test_support (it's handy!).
This commit is contained in:
parent
5ded1bf5c7
commit
c2fe618575
4 changed files with 22 additions and 6 deletions
|
@ -75,7 +75,7 @@ structseq_slice(PyStructSequence *obj, int low, int high)
|
|||
for(i = low; i < high; ++i) {
|
||||
PyObject *v = obj->ob_item[i];
|
||||
Py_INCREF(v);
|
||||
PyTuple_SET_ITEM(np, i, v);
|
||||
PyTuple_SET_ITEM(np, i-low, v);
|
||||
}
|
||||
return (PyObject *) np;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue