This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
ensure hash iterator gets deleted
authorDavid Mitchell <davem@iabyn.com>
Wed, 11 May 2011 15:17:08 +0000 (16:17 +0100)
committerDavid Mitchell <davem@iabyn.com>
Thu, 19 May 2011 13:49:44 +0000 (14:49 +0100)
commit00a1a6438090b41d961c8127cc4e10d84fa70977
treeb853ea33ce4383f808a8002b90f14b1e865c7d73
parent9c80917f6e6fa3fccba3eea4e7014931b5fa5233
ensure hash iterator gets deleted

The recent commits to make sv_clear() iterative when freeing a hash,
introduced a bug. If the hash only has one key, and that becomes the
iterator, and is then deleted; then when the hash is freed, the LAZYDEL
feature is skipped, and the iterated hash value fails to get deleted.

The fix is simple: check for LAZYDEL before return is keys == 0.
hv.c
t/op/each.t