diff --git a/gi/pygi-invoke.c b/gi/pygi-invoke.c
index d8e4b35..e0bdd86 100644
--- a/gi/pygi-invoke.c
+++ b/gi/pygi-invoke.c
@@ -181,6 +181,7 @@ _prepare_invocation_state (struct invocation_state *state,
                 }
 
                 g_assert (length_arg_pos < state->n_args);
+                g_warn_if_fail (!state->args_is_auxiliary[length_arg_pos]);
                 state->args_is_auxiliary[length_arg_pos] = TRUE;
 
                 if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) {
