Commit 044a2e51 authored by Kevin Modzelewski's avatar Kevin Modzelewski

A few small fixes

parent fc46bc42
...@@ -83,7 +83,7 @@ Box* listiter_next(Box* s) noexcept { ...@@ -83,7 +83,7 @@ Box* listiter_next(Box* s) noexcept {
Box* rtn = self->l->elts->elts[self->pos]; Box* rtn = self->l->elts->elts[self->pos];
self->pos++; self->pos++;
return rtn; return incref(rtn);
} }
template <ExceptionStyle S> Box* listiterNext(Box* s) noexcept(S == CAPI) { template <ExceptionStyle S> Box* listiterNext(Box* s) noexcept(S == CAPI) {
......
...@@ -4938,6 +4938,7 @@ Box* binopInternal(Box* lhs, Box* rhs, int op_type, bool inplace, BinopRewriteAr ...@@ -4938,6 +4938,7 @@ Box* binopInternal(Box* lhs, Box* rhs, int op_type, bool inplace, BinopRewriteAr
Box* irtn = NULL; Box* irtn = NULL;
if (inplace) { if (inplace) {
assert(0 && "check refcounting");
// XXX I think we need to make sure that we keep these strings alive? // XXX I think we need to make sure that we keep these strings alive?
DecrefHandle<BoxedString> iop_name(getInplaceOpName(op_type)); DecrefHandle<BoxedString> iop_name(getInplaceOpName(op_type));
if (rewrite_args) { if (rewrite_args) {
...@@ -4976,7 +4977,7 @@ Box* binopInternal(Box* lhs, Box* rhs, int op_type, bool inplace, BinopRewriteAr ...@@ -4976,7 +4977,7 @@ Box* binopInternal(Box* lhs, Box* rhs, int op_type, bool inplace, BinopRewriteAr
} }
} }
BoxedString* op_name = getOpName(op_type); BORROWED(BoxedString*) op_name = getOpName(op_type);
Box* lrtn; Box* lrtn;
if (rewrite_args) { if (rewrite_args) {
CallattrRewriteArgs srewrite_args(rewrite_args->rewriter, rewrite_args->lhs, rewrite_args->destination); CallattrRewriteArgs srewrite_args(rewrite_args->rewriter, rewrite_args->lhs, rewrite_args->destination);
...@@ -5022,6 +5023,8 @@ Box* binopInternal(Box* lhs, Box* rhs, int op_type, bool inplace, BinopRewriteAr ...@@ -5022,6 +5023,8 @@ Box* binopInternal(Box* lhs, Box* rhs, int op_type, bool inplace, BinopRewriteAr
} }
BoxedString* rop_name = getReverseOpName(op_type); BoxedString* rop_name = getReverseOpName(op_type);
AUTO_DECREF(rop_name);
Box* rrtn = callattrInternal1<CXX, REWRITABLE>(rhs, rop_name, CLASS_ONLY, NULL, ArgPassSpec(1), lhs); Box* rrtn = callattrInternal1<CXX, REWRITABLE>(rhs, rop_name, CLASS_ONLY, NULL, ArgPassSpec(1), lhs);
if (rrtn != NULL && rrtn != NotImplemented) if (rrtn != NULL && rrtn != NotImplemented)
return rrtn; return rrtn;
......
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