Commit adccd81c authored by Kevin Modzelewski's avatar Kevin Modzelewski Committed by Kevin Modzelewski

Small fixes

parent 294a77b4
......@@ -696,11 +696,14 @@ ExcInfo* getFrameExcInfo() {
if (!copy_from_exc->type) {
// No exceptions found:
*copy_from_exc = ExcInfo(None, None, NULL);
*copy_from_exc = ExcInfo(incref(None), incref(None), NULL);
}
for (auto* ex : to_update) {
*ex = *copy_from_exc;
Py_INCREF(ex->type);
Py_INCREF(ex->value);
Py_XINCREF(ex->traceback);
}
assert(cur_exc);
return cur_exc;
......
......@@ -1395,7 +1395,7 @@ static void _addFuncIntUnknown(const char* name, ConcreteCompilerType* rtn_type,
static Box* intIntGetset(Box* b, void*) {
if (b->cls == int_cls) {
return b;
return incref(b);
} else {
assert(PyInt_Check(b));
return boxInt(static_cast<BoxedInt*>(b)->n);
......
......@@ -2056,7 +2056,8 @@ Box* dataDescriptorInstanceSpecialCases(GetattrRewriteArgs* rewrite_args, BoxedS
case BoxedMemberDescriptor::TYPE: { \
if (rewrite_args) { \
RewriterVar* r_unboxed_val = rewrite_args->obj->getAttrCast<type, cast>(member_desc->offset); \
RewriterVar* r_rtn = rewrite_args->rewriter->call(true, (void*)boxFn, r_unboxed_val); \
RewriterVar* r_rtn \
= rewrite_args->rewriter->call(true, (void*)boxFn, r_unboxed_val)->setType(RefType::OWNED); \
/* XXX assuming that none of these throw a capi error! */ \
rewrite_args->setReturn(r_rtn, ReturnConvention::HAS_RETURN); \
} \
......
......@@ -3443,8 +3443,10 @@ static void typeSetName(Box* b, Box* v, void*) {
}
BoxedHeapClass* ht = static_cast<BoxedHeapClass*>(type);
auto old_name = ht->ht_name;
ht->ht_name = incref(s);
ht->tp_name = s->data();
Py_DECREF(old_name);
}
static Box* typeBases(Box* b, void*) {
......
# expected: reffail
# TODO This is a hodgepodge of stuff, should probably organize it better
# maybe merge some of it into dunder_descriptors?
......
# expected: reffail
# run_args: -n
# statcheck: noninit_count('slowpath_getattr') <= 10
# statcheck: noninit_count('slowpath_setattr') <= 10
......
# expected: reffail
import hashlib
#for m in [hashlib.md5(), hashlib.sha1(), hashlib.sha256(), hashlib.sha512()]:
......
# expected: reffail
import sys, traceback
def lumberjack():
......
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