summaryrefslogtreecommitdiff
path: root/ext/Devel-Peek
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-12-02 16:01:10 +0000
committerNicholas Clark <nick@ccl4.org>2009-12-02 16:06:09 +0000
commitc2123ae380a372d506d1b6938667bd785fd8728b (patch)
tree68d6297e99a7e461c2c1e90a5f28c268f5f0988f /ext/Devel-Peek
parent99f78760b2efe944c387d081557a95783f362f6a (diff)
downloadperl-c2123ae380a372d506d1b6938667bd785fd8728b.tar.gz
Ensure that pp_qr returns a new regexp SV each time. Resolves RT #69852.
Instead of returning a(nother) reference to the (pre-compiled) regexp in the optree, use reg_temp_copy() to create a copy of it, and return a reference to that. This resolves issues about Regexp::DESTROY not being called in a timely fashion (the original bug tracked by RT #69852), as well as bugs related to blessing regexps, and of assigning to regexps, as described in correspondence added to the ticket. It transpires that we also need to undo the SvPVX() sharing when ithreads cloning a Regexp SV, because mother_re is set to NULL, instead of a cloned copy of the mother_re. This change might fix bugs with regexps and threads in certain other situations, but as yet neither tests nor bug reports have indicated any problems, so it might not actually be an edge case that it's possible to reach.
Diffstat (limited to 'ext/Devel-Peek')
-rw-r--r--ext/Devel-Peek/t/Peek.t6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/Devel-Peek/t/Peek.t b/ext/Devel-Peek/t/Peek.t
index aeb36d074d..33958b81d8 100644
--- a/ext/Devel-Peek/t/Peek.t
+++ b/ext/Devel-Peek/t/Peek.t
@@ -325,12 +325,12 @@ do_test(15,
FLAGS = \\(ROK\\)
RV = $ADDR
SV = REGEXP\\($ADDR\\) at $ADDR
- REFCNT = 2
+ REFCNT = 1
FLAGS = \\(OBJECT,POK,pPOK\\)
IV = 0
- PV = $ADDR "\\(\\?-xism:tic\\)"\\\0
+ PV = $ADDR "\\(\\?-xism:tic\\)"
CUR = 12
- LEN = \\d+
+ LEN = 0
STASH = $ADDR\\t"Regexp"');
} else {
do_test(15,