Commit cdba6c21 authored by Marius Wachtler's avatar Marius Wachtler

don't crash when a generator has more than 3 arguments and kwargs

parent 802ad225
......@@ -467,7 +467,7 @@ extern "C" BoxedGenerator::BoxedGenerator(BoxedFunctionBase* function, Box* arg1
this->args = new (numArgs) GCdArray();
memcpy(&this->args->elts[0], args, numArgs * sizeof(Box*));
for (int i = 0; i < numArgs; i++) {
Py_INCREF(args[i]);
Py_XINCREF(args[i]);
}
}
......
......@@ -142,3 +142,8 @@ def this_is_not_generator():
def f():
yield
print type(this_is_not_generator())
# we used to crash when a generator had more than 3 arguments and kwargs (because they can be NULL)
def G(a, b, c, *args, **kwargs):
yield 1
print list(G(1,2,2))
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