summaryrefslogtreecommitdiff
path: root/ext/Devel-Peek
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-02-09 08:11:34 -0800
committerJesse Vincent <jesse@bestpractical.com>2010-02-09 08:29:00 -0800
commitb9ad13acb338e137b9560a8b578e1f7c983706be (patch)
tree97af2c1b5fb29ce34a1fdd518800ee29c0ad8509 /ext/Devel-Peek
parent3141af47a8bc3e77d5fb9552cf3d33e5b7413d7a (diff)
downloadperl-b9ad13acb338e137b9560a8b578e1f7c983706be.tar.gz
Fix for non-regexps being upgraded to SVt_REGEXP
$ ./perl -lwe '$a = ${qr//}; $a = 2; print re::is_regexp(\$a)' 1 It is possible for arbitrary SVs (eg PAD entries) to be upgraded to SVt_REGEXP. (This is new with first class regexps) Whilst the example above does not SEGV, it will be possible to write code that will cause SEGVs (or worse) at the point when the scalar is freed, because the code in sv_clear() assumes that all scalars of type SVt_REGEXP *are* regexps, and passes them to pregfree2(), which assumes that pointers within are valid.
Diffstat (limited to 'ext/Devel-Peek')
-rw-r--r--ext/Devel-Peek/t/Peek.t2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/Devel-Peek/t/Peek.t b/ext/Devel-Peek/t/Peek.t
index fc26157022..3d282d35b5 100644
--- a/ext/Devel-Peek/t/Peek.t
+++ b/ext/Devel-Peek/t/Peek.t
@@ -326,7 +326,7 @@ do_test(15,
RV = $ADDR
SV = REGEXP\\($ADDR\\) at $ADDR
REFCNT = 1
- FLAGS = \\(OBJECT,POK,pPOK\\)
+ FLAGS = \\(OBJECT,POK,FAKE,pPOK\\)
IV = 0
PV = $ADDR "\\(\\?-xism:tic\\)"
CUR = 12