summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-01-08 17:10:29 +0000
committerNicholas Clark <nick@ccl4.org>2008-01-08 17:10:29 +0000
commit10599a699e18a26ba9c9154ce2c01e7cf53249ce (patch)
tree10bede87c74177d62b57585acf5c760f0469be98 /pp_hot.c
parent9a8b670905dec428f75660a49918537c7271b6b6 (diff)
downloadperl-10599a699e18a26ba9c9154ce2c01e7cf53249ce.tar.gz
In PL_regexp_padav, store regexps via real references, rather than
hiding them within IVs. We can do this now that they are real SV pointers. p4raw-id: //depot/perl@32900
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 7a71b6f79e..d391272f64 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1197,9 +1197,18 @@ PP(pp_qr)
dVAR; dSP;
register PMOP * const pm = cPMOP;
REGEXP * rx = PM_GETRE(pm);
- SV * const pkg = CALLREG_PACKAGE(rx);
+ SV * const pkg = rx ? CALLREG_PACKAGE(rx) : NULL;
SV * const rv = sv_newmortal();
+ if (!rx) {
+ /* FIXME ORANGE.
+ This can go if/when regexps are stored directly in PL_regex_pad
+ rather than via references. do_clean_objs finds and frees them
+ when they are stored as references. */
+ XPUSHs(rv);
+ RETURN;
+ }
+
SvUPGRADE(rv, SVt_IV);
/* This RV is about to own a reference to the regexp. (In addition to the
reference already owned by the PMOP. */