Merge pull request #4005 from Infinisil/fix-autoArgs

Fix auto argument passing for more auto arguments than formals
This commit is contained in:
Eelco Dolstra 2020-09-14 13:31:23 +02:00 committed by GitHub
commit 35ba092019
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1348,7 +1348,7 @@ void EvalState::autoCallFunction(Bindings & args, Value & fun, Value & res)
}
Value * actualArgs = allocValue();
mkAttrs(*actualArgs, fun.lambda.fun->formals->formals.size());
mkAttrs(*actualArgs, std::max(static_cast<uint32_t>(fun.lambda.fun->formals->formals.size()), args.size()));
if (fun.lambda.fun->formals->ellipsis) {
// If the formals have an ellipsis (eg the function accepts extra args) pass