diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-01-08 17:10:29 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-01-08 17:10:29 +0000 |
commit | 10599a699e18a26ba9c9154ce2c01e7cf53249ce (patch) | |
tree | 10bede87c74177d62b57585acf5c760f0469be98 /pp_hot.c | |
parent | 9a8b670905dec428f75660a49918537c7271b6b6 (diff) | |
download | perl-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.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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. */ |