[ruamoko] Set pr_argc before calling error methods

Builtins calling ruamoko code need to be careful of the arg count in
case the ruamoko function uses varargs.
This commit is contained in:
Bill Currie 2020-03-12 19:32:09 +09:00
parent 21a8559674
commit 08b7064a3f
1 changed files with 2 additions and 0 deletions

View File

@ -1289,6 +1289,7 @@ rua___obj_forward (progs_t *pr)
P_POINTER (pr, 0) = PR_SetPointer (pr, obj);
P_POINTER (pr, 1) = PR_SetPointer (pr, err_sel);
P_POINTER (pr, 2) = PR_SetPointer (pr, sel);
pr->pr_argc = 3;
PR_CallFunction (pr, imp);
return;
}
@ -1306,6 +1307,7 @@ rua___obj_forward (progs_t *pr)
P_POINTER (pr, 0) = PR_SetPointer (pr, obj);
P_POINTER (pr, 1) = PR_SetPointer (pr, err_sel);
P_POINTER (pr, 2) = PR_SetTempString (pr, probj->msg->str);
pr->pr_argc = 3;
PR_CallFunction (pr, imp);
return;
}