Commit 2f54cb05 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Minor fixes

parent d093c4db
......@@ -164,13 +164,14 @@ Box* tupleAdd(BoxedTuple* self, Box* rhs) {
if (!PyTuple_Check(rhs)) {
return incref(NotImplemented);
}
assert(0 && "check refcounting");
BoxedTuple* _rhs = static_cast<BoxedTuple*>(rhs);
BoxedTuple* rtn = BoxedTuple::create(self->size() + _rhs->size());
memmove(&rtn->elts[0], &self->elts[0], self->size() * sizeof(Box*));
memmove(&rtn->elts[self->size()], &_rhs->elts[0], _rhs->size() * sizeof(Box*));
for (int i = 0; i < rtn->size(); i++)
Py_INCREF(rtn->elts[i]);
return rtn;
}
......@@ -389,8 +390,7 @@ extern "C" Box* tupleNew(Box* _cls, BoxedTuple* args, BoxedDict* kwargs) {
}
}
extern "C" int PyTuple_SetItem(PyObject* op, Py_ssize_t i, PyObject* newitem) noexcept {
assert(0 && "check refcounting");
extern "C" int PyTuple_SetItem(PyObject* op, Py_ssize_t i, STOLEN(PyObject*) newitem) noexcept {
RELEASE_ASSERT(PyTuple_Check(op), "");
BoxedTuple* t = static_cast<BoxedTuple*>(op);
......@@ -403,7 +403,6 @@ extern "C" int PyTuple_SetItem(PyObject* op, Py_ssize_t i, PyObject* newitem) no
}
extern "C" PyObject* PyTuple_Pack(Py_ssize_t n, ...) noexcept {
assert(0 && "check refcounting");
va_list vargs;
va_start(vargs, n);
......
......@@ -3730,7 +3730,7 @@ int BoxedClosure::traverse(Box* _o, visitproc visit, void* arg) noexcept {
BoxedClosure* o = (BoxedClosure*)_o;
for (int i = 0; i < o->nelts; i++) {
Py_XDECREF(o->elts[i]);
Py_VISIT(o->elts[i]);
}
return 0;
......
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