fix VariantCall default parameter ordering

This commit is contained in:
Ibrahn Sahir 2017-12-31 14:50:37 +00:00
parent 548bd4ef1d
commit 96706168d0

View file

@ -101,9 +101,10 @@ struct _VariantCall {
const Variant *newargs[VARIANT_ARG_MAX];
for (int i = 0; i < p_argcount; i++)
newargs[i] = p_args[i];
int defargcount = def_argcount;
// fill in any remaining parameters with defaults
int first_default_arg = arg_count - def_argcount;
for (int i = p_argcount; i < arg_count; i++)
newargs[i] = &default_args[defargcount - (i - p_argcount) - 1]; //default arguments
newargs[i] = &default_args[i - first_default_arg];
#ifdef DEBUG_ENABLED
if (!verify_arguments(newargs, r_error))
return;