avhv_keys under Digital UNIX made avhv.t fail because *keysp was
Malcolm Beattie [Wed, 19 Nov 1997 15:33:23 +0000 (15:33 +0000)]
changed by mg_get(*keysp) (!). Introducing a new local variable
fixed it but I don't know if it's a compiler problem or some
other corruption happening elsewhere.

p4raw-id: //depot/perl@269

av.c

diff --git a/av.c b/av.c
index 5ac6858..1768442 100644 (file)
--- a/av.c
+++ b/av.c
@@ -471,12 +471,13 @@ avhv_keys(AV *av)
 
     keysp = av_fetch(av, 0, FALSE);
     if (keysp) {
-       if (SvGMAGICAL(*keysp))
-           mg_get(*keysp);
-       if (SvROK(*keysp)) {
-           SV *hash = SvRV(*keysp);
-           if (SvTYPE(hash) == SVt_PVHV)
-               keys = (HV*)hash;
+       SV *sv = *keysp;
+       if (SvGMAGICAL(sv))
+           mg_get(sv);
+       if (SvROK(sv)) {
+           sv = SvRV(sv);
+           if (SvTYPE(sv) == SVt_PVHV)
+               keys = (HV*)sv;
        }
     }
     if (!keys)