Merge pull request #15220 from ibrahn/variantcall-defargs-fix
fix VariantCall default parameter ordering
This commit is contained in:
commit
6b6f60defc
1 changed files with 3 additions and 2 deletions
|
@ -101,9 +101,10 @@ struct _VariantCall {
|
||||||
const Variant *newargs[VARIANT_ARG_MAX];
|
const Variant *newargs[VARIANT_ARG_MAX];
|
||||||
for (int i = 0; i < p_argcount; i++)
|
for (int i = 0; i < p_argcount; i++)
|
||||||
newargs[i] = p_args[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++)
|
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
|
#ifdef DEBUG_ENABLED
|
||||||
if (!verify_arguments(newargs, r_error))
|
if (!verify_arguments(newargs, r_error))
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue