This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #85026] deleting elements in a HASH iterator
[perl5.git] / mg.c
diff --git a/mg.c b/mg.c
index d061c51..85b5461 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1362,7 +1362,6 @@ int
 Perl_magic_clearsig(pTHX_ SV *sv, MAGIC *mg)
 {
     PERL_ARGS_ASSERT_MAGIC_CLEARSIG;
-    PERL_UNUSED_ARG(sv);
 
     magic_setsig(NULL, mg);
     return sv_unmagic(sv, mg->mg_type);
@@ -1732,7 +1731,7 @@ Perl_magic_getnkeys(pTHX_ SV *sv, MAGIC *mg)
     if (hv) {
          (void) hv_iterinit(hv);
          if (! SvTIED_mg((const SV *)hv, PERL_MAGIC_tied))
-            i = HvKEYS(hv);
+            i = HvUSEDKEYS(hv);
          else {
             while (hv_iternext(hv))
                 i++;