Commit e9fd04b4 authored by Marius Wachtler's avatar Marius Wachtler

Fix strange slice GC issue

Looks like allocating the BoxedSlice before the arguments caused a issue?!?
parent 0c49d8ec
......@@ -447,7 +447,7 @@ extern "C" PyObject* PySequence_GetItem(PyObject* o, Py_ssize_t i) noexcept {
extern "C" PyObject* PySequence_GetSlice(PyObject* o, Py_ssize_t i1, Py_ssize_t i2) noexcept {
try {
// Not sure if this is really the same:
return getitem(o, new BoxedSlice(boxInt(i1), boxInt(i2), None));
return getitem(o, createSlice(boxInt(i1), boxInt(i2), None));
} catch (ExcInfo e) {
Py_FatalError("unimplemented");
}
......
......@@ -785,10 +785,11 @@ extern "C" int PyList_SetSlice(PyObject* a, Py_ssize_t ilow, Py_ssize_t ihigh, P
ASSERT(isSubclass(l->cls, list_cls), "%s", l->cls->tp_name);
try {
BoxedSlice* slice = (BoxedSlice*)createSlice(boxInt(ilow), boxInt(ihigh), None);
if (v)
listSetitemSlice(l, new BoxedSlice(boxInt(ilow), boxInt(ihigh), None), v);
listSetitemSlice(l, slice, v);
else
listDelitemSlice(l, new BoxedSlice(boxInt(ilow), boxInt(ihigh), None));
listDelitemSlice(l, slice);
return 0;
} catch (ExcInfo e) {
setCAPIException(e);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment