This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: PATCH for study/foo/
authorIlya Zakharevich <ilya@math.berkeley.edu>
Tue, 9 Jun 1998 23:09:55 +0000 (19:09 -0400)
committerGurusamy Sarathy <gsar@cpan.org>
Wed, 10 Jun 1998 07:40:30 +0000 (07:40 +0000)
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));
     }