schema compile BUGFIX iteration skipping items

Fixes #1737
diff --git a/src/schema_compile.c b/src/schema_compile.c
index 5b52a19..179d3c0 100644
--- a/src/schema_compile.c
+++ b/src/schema_compile.c
@@ -1445,7 +1445,8 @@
     }
 
     /* remove disabled enums/bits */
-    for (i = 0; i < ds_unres->disabled_bitenums.count; ++i) {
+    while (ds_unres->disabled_bitenums.count) {
+        i = ds_unres->disabled_bitenums.count - 1;
         node = ds_unres->disabled_bitenums.objs[i];
         cctx.cur_mod = node->module;
         cctx.pmod = node->module->parsed;