mirror of
https://github.com/micropython/micropython.git
synced 2026-01-08 13:10:21 +01:00
objfun: Fix default arguments filling loop, was broken in presense of kwargs.
This commit is contained in:
@@ -299,9 +299,9 @@ continue2:;
|
||||
// Now fill in defaults
|
||||
mp_obj_t *d = &flat_args[self->n_args - 1];
|
||||
mp_obj_t *s = &self->extra_args[self->n_def_args - 1];
|
||||
for (int i = self->n_def_args; i > 0; i--) {
|
||||
for (int i = self->n_def_args; i > 0; i--, d--, s--) {
|
||||
if (*d == MP_OBJ_NULL) {
|
||||
*d-- = *s--;
|
||||
*d = *s;
|
||||
}
|
||||
}
|
||||
DEBUG_printf("Args after filling defaults: ");
|
||||
|
||||
Reference in New Issue
Block a user