diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-10-30 23:20:46 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-10-30 23:20:46 (GMT) |
commit | c2fe618575aaf58ddf36d04d96431d6dc819ef31 (patch) | |
tree | f083f6119e71555915d02a04de993e97d7d36ffc /Objects | |
parent | 5ded1bf5c7773b7a13e1907e3cfb4826c402d7b2 (diff) | |
download | cpython-c2fe618575aaf58ddf36d04d96431d6dc819ef31.zip cpython-c2fe618575aaf58ddf36d04d96431d6dc819ef31.tar.gz cpython-c2fe618575aaf58ddf36d04d96431d6dc819ef31.tar.bz2 |
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!).
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/structseq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c index 50448c2..7ad607b 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -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; } |