Re #18521: move array bounds check before array access.
diff --git a/Python/getargs.c b/Python/getargs.c
index 2c2628f..9d72752 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -376,7 +376,7 @@
                           "argument %" PY_FORMAT_SIZE_T "d", iarg);
             i = 0;
             p += strlen(p);
-            while (levels[i] > 0 && i < 32 && (int)(p-buf) < 220) {
+            while (i < 32 && levels[i] > 0 && (int)(p-buf) < 220) {
                 PyOS_snprintf(p, sizeof(buf) - (p - buf),
                               ", item %d", levels[i]-1);
                 p += strlen(p);