dereference while iterating a hash. This should never happen unless
the hash lies about how many keys it has, so croak if a fib is spotted.
p4raw-id: //depot/perl@27825
#else
HE *he = hv_iternext(hv);
#endif
- SV *key = hv_iterkeysv(he);
+ SV *key;
+
+ if (!he)
+ CROAK(("Hash %p inconsistent - expected %d keys, %dth is NULL", hv, len, i));
+ key = hv_iterkeysv(he);
av_store(av, AvFILLp(av)+1, key); /* av_push(), really */
}