Commit a74aff98 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix test_set crash

We were missing a guard and we ended up calling the wrong function :/

Still some other issuse with this test
parent a941cdf4
# expected: reffail
# - unknown segfault
# - leaked refs
import unittest
from test import test_support
import gc
......
......@@ -703,6 +703,8 @@ static Box* assertInitNone(STOLEN(Box*) rtn, STOLEN(Box*) obj) {
}
static PyObject* cpythonTypeCall(BoxedClass* type, PyObject* args, PyObject* kwds) {
assert(PyType_Check(type));
Box* r = cpython_type_call(type, args, kwds);
if (!r)
throwCAPIException();
......@@ -810,6 +812,10 @@ static Box* typeCallInner(CallRewriteArgs* rewrite_args, ArgPassSpec argspec, Bo
}
}
if (rewrite_args) {
rewrite_args->arg1->addGuard((intptr_t)cls);
}
// Special-case unicode for now, maybe there's something about this that can eventually be generalized:
if (cls->tp_new == unicode_cls->tp_new) {
// TODO: implement
......@@ -824,10 +830,6 @@ static Box* typeCallInner(CallRewriteArgs* rewrite_args, ArgPassSpec argspec, Bo
assert(S == CXX && "implement me");
if (rewrite_args) {
rewrite_args->arg1->addGuard((intptr_t)cls);
}
ParamReceiveSpec paramspec(4, 3, false, false);
bool rewrite_success = false;
static ParamNames param_names({ "", "string", "encoding", "errors" }, "", "");
......
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