summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-06-27 20:51:04 +0200
committerNicholas Clark <nick@ccl4.org>2011-07-01 14:05:40 +0200
commit4185c9197f4aefd1943fba0b9999fc3200fd902c (patch)
tree34f48cfebcfa6a796f4496c890400c3a7d89da6c /regexec.c
parent75fc7bf602cd498829b35780623ebe139c0a0483 (diff)
downloadperl-4185c9197f4aefd1943fba0b9999fc3200fd902c.tar.gz
Store C<study>'s data in in mg_ptr instead of interpreter variables.
This allows more than one C<study> to be active at the same time. It eliminates PL_screamfirst, PL_lastscream, PL_maxscream.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/regexec.c b/regexec.c
index 00fc7124f6..b9677ecb8d 100644
--- a/regexec.c
+++ b/regexec.c
@@ -695,8 +695,13 @@ Perl_re_intuit_start(pTHX_ REGEXP * const rx, SV *sv, char *strpos,
if ((flags & REXEC_SCREAM) && SvSCREAM(sv)) {
I32 p = -1; /* Internal iterator of scream. */
I32 * const pp = data ? data->scream_pos : &p;
+ const MAGIC *mg;
- if (PL_screamfirst[BmRARE(check)] != -1
+ assert(SvMAGICAL(sv));
+ mg = mg_find(sv, PERL_MAGIC_study);
+ assert(mg);
+
+ if (((I32 *)mg->mg_ptr)[BmRARE(check)] != -1
|| ( BmRARE(check) == '\n'
&& (BmPREVIOUS(check) == SvCUR(check) - 1)
&& SvTAIL(check) ))