Commit cc2add2a authored by Kevin Modzelewski's avatar Kevin Modzelewski

test_cmath.py

parent a0412c43
# expected: reffail
# - fails in interpreter due to keeping refcounts a bit too long
"""Test the arraymodule.
Roger E. Masse
"""
......
# expected: reffail
# - generator abandonment
import sys, itertools, unittest
from test import test_support
import ast
......
# expected: reffail
from test.test_support import run_unittest
from test.test_math import parse_testfile
import unittest
......
......@@ -157,6 +157,7 @@ extern "C" double PyFloat_AsDouble(PyObject* o) noexcept {
fo = (BoxedFloat*)(*nb->nb_float)(o);
if (fo == NULL)
return -1;
AUTO_DECREF(fo);
if (!PyFloat_Check(fo)) {
PyErr_SetString(PyExc_TypeError, "nb_float should return float object");
return -1;
......
......@@ -2313,7 +2313,8 @@ Box* getattrInternalEx(Box* obj, BoxedString* attr, GetattrRewriteArgs* rewrite_
RewriterVar* r_rtn
= rewrite_args->rewriter->call(true, (void*)Helper::call, rewrite_args->obj,
rewrite_args->rewriter->loadConst((intptr_t)attr, Location::forArg(1)),
rewrite_args->rewriter->loadConst(cls_only, Location::forArg(2)));
rewrite_args->rewriter->loadConst(cls_only, Location::forArg(2)))
->setType(RefType::OWNED);
rewrite_args->setReturn(r_rtn, ReturnConvention::NOEXC_POSSIBLE);
return Helper::call(obj, attr, cls_only);
}
......@@ -2584,9 +2585,10 @@ Box* getattrInternalGeneric(Box* obj, BoxedString* attr, GetattrRewriteArgs* rew
static Box* call(Box* obj, BoxedString* attr) { return xincref(obj->getattr(attr)); }
};
RewriterVar* r_rtn = rewrite_args->rewriter->call(
false, (void*)Helper::call, rewrite_args->obj,
rewrite_args->rewriter->loadConst((intptr_t)attr, Location::forArg(1)));
RewriterVar* r_rtn
= rewrite_args->rewriter->call(false, (void*)Helper::call, rewrite_args->obj,
rewrite_args->rewriter->loadConst(
(intptr_t)attr, Location::forArg(1)))->setType(RefType::OWNED);
rewrite_args->setReturn(r_rtn, ReturnConvention::NOEXC_POSSIBLE);
return Helper::call(obj, attr);
}
......
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