This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op.c: ck_grep does not need to call listkids
[perl5.git] / doio.c
diff --git a/doio.c b/doio.c
index 5682426..fd6683d 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -2283,9 +2283,10 @@ Perl_do_shmio(pTHX_ I32 optype, SV **mark, SV **sp)
     if (optype == OP_SHMREAD) {
        char *mbuf;
        /* suppress warning when reading into undef var (tchrist 3/Mar/00) */
+       SvGETMAGIC(mstr);
+       SvUPGRADE(mstr, SVt_PV);
        if (! SvOK(mstr))
            sv_setpvs(mstr, "");
-       SvUPGRADE(mstr, SVt_PV);
        SvPOK_only(mstr);
        mbuf = SvGROW(mstr, (STRLEN)msize+1);