Re: PATCH for study/foo/
Ilya Zakharevich [Tue, 9 Jun 1998 23:09:55 +0000 (19:09 -0400)]
Message-Id: <199806100309.XAA04974@monk.mps.ohio-state.edu>

p4raw-id: //depot/perl@1111

pp.c

diff --git a/pp.c b/pp.c
index aeaca4c..c65ed1c 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -604,8 +604,11 @@ PP(pp_study)
     if(unop->op_first && unop->op_first->op_type == OP_PUSHRE) {
        PMOP *pm = (PMOP *)unop->op_first;
        SV *rv = sv_newmortal();
+       REGEXP *re = pm->op_pmregexp;
+
        sv = newSVrv(rv, "Regexp");
-       sv_magic(sv,(SV*)ReREFCNT_inc(pm->op_pmregexp),'r',0,0);
+       sv_setpvn(sv,re->precomp,re->prelen);
+       sv_magic(sv,(SV*)ReREFCNT_inc(re),'r',0,0);
        RETURNX(PUSHs(rv));
     }