Commit 647363c8 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Merge pull request #110 from undingen/defaults_crash

Fix crash when passing alot of defaults
parents da069735 7681663b
......@@ -1849,8 +1849,11 @@ Box* callFunc(BoxedFunction* func, CallRewriteArgs* rewrite_args, ArgPassSpec ar
Box* oarg1 = NULL, *oarg2 = NULL, *oarg3 = NULL;
Box** oargs = NULL;
if (num_output_args > 3)
oargs = (Box**)alloca((num_output_args - 3) * sizeof(Box*));
if (num_output_args > 3) {
int size = (num_output_args - 3) * sizeof(Box*);
oargs = (Box**)alloca(size);
memset(&oargs[0], 0, size);
}
////
// First, match up positional parameters to positional/varargs:
......@@ -1867,7 +1870,7 @@ Box* callFunc(BoxedFunction* func, CallRewriteArgs* rewrite_args, ArgPassSpec ar
getArg(i + positional_to_positional, oarg1, oarg2, oarg3, oargs) = varargs[i];
}
std::vector<bool> params_filled(argspec.num_args, false);
std::vector<bool> params_filled(num_output_args, false);
for (int i = 0; i < positional_to_positional + varargs_to_positional; i++) {
params_filled[i] = true;
}
......
......@@ -43,3 +43,7 @@ def f3():
f(4, [])
f(5, [])
f3()
def f4(a=1, b=2, c=3, d=4, e=5, f=6, g=7, h=8):
print a, b, c, d, e, f, g, h
f4()
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