summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-06-08 18:16:56 -0400
committerGurusamy Sarathy <gsar@cpan.org>1998-06-10 07:21:21 +0000
commite2d46a1de163ba101bb4392a8fa6d97ca3c9a323 (patch)
tree9dc1bbb410301b64987309b0fbfdd19c0687fc62 /pp_ctl.c
parent49136ef87c7a099210ef3e193f1a24f3def277ff (diff)
downloadperl-e2d46a1de163ba101bb4392a8fa6d97ca3c9a323.tar.gz
Applied patch, followed by tweaks to *.sym and `perl embed.pl`
Message-Id: <199806090216.WAA02041@monk.mps.ohio-state.edu> Subject: [PATCH 5.004_66] Resend of RE cache patch (modified) p4raw-id: //depot/perl@1105
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 444036ea7e..9b924bc0f8 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -76,8 +76,8 @@ PP(pp_regcomp) {
MAGIC *mg = Null(MAGIC*);
tmpstr = POPs;
- if(SvROK(tmpstr)) {
- SV *sv = SvRV(tmpstr);
+ if(SvROK(tmpstr) || SvRMAGICAL(tmpstr)) {
+ SV *sv = SvROK(tmpstr) ? SvRV(tmpstr) : tmpstr;
if(SvMAGICAL(sv))
mg = mg_find(sv, 'r');
}
@@ -101,6 +101,7 @@ PP(pp_regcomp) {
pm->op_pmflags = pm->op_pmpermflags; /* reset case sensitivity */
pm->op_pmregexp = pregcomp(t, t + len, pm);
+ sv_magic(tmpstr,(SV*)ReREFCNT_inc(pm->op_pmregexp),'r',0,0);
}
}