summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-06-22 00:51:14 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-06-22 23:16:41 -0700
commitecff11eb0f000fc186c1b5652087c979947e4389 (patch)
treef06f7bcd08f2df9b2485692b603a1c0e3739716e
parent5a3c73497c32449b69801228df80f2b7aafce13b (diff)
downloadperl-ecff11eb0f000fc186c1b5652087c979947e4389.tar.gz
Stop SVt_REGEXPs from being upgraded.
Any code that is going to write over a REGEXP will call sv_force_normal first, which converts it to This code started crashing in 5.12: $_ = qr//; @INC = sub { $_ }; require foo; Search pattern not terminated at /loader/0x7fe3b082c2e8/foo.pm line 1. Compilation failed in require at - line 4. Segmentation fault: 11 With current bleadperl: foo.pm did not return a true value at - line 4. Segmentation fault: 11 This change makes it like this instead: Can't upgrade REGEXP (8) to 15 at - line 3. which is certainly an improvement. We shouldn’t be getting any error at all (OK, just a syntax error because (?^:) is not a valid expres- sion), and the next commit will fix that, but this commit at least turns a crash into a panic, in case future changes accidentally send a regexp through sv_upgrade(sv, SVt_PVIO).
-rw-r--r--sv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index 52af1d2043..db0fac54c3 100644
--- a/sv.c
+++ b/sv.c
@@ -921,7 +921,7 @@ static const struct body_details bodies_by_type[] = {
{ sizeof(regexp),
sizeof(regexp),
0,
- SVt_REGEXP, FALSE, NONV, HASARENA,
+ SVt_REGEXP, TRUE, NONV, HASARENA,
FIT_ARENA(0, sizeof(regexp))
},