diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-06-27 20:51:04 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-07-01 14:05:40 +0200 |
commit | 4185c9197f4aefd1943fba0b9999fc3200fd902c (patch) | |
tree | 34f48cfebcfa6a796f4496c890400c3a7d89da6c /regexec.c | |
parent | 75fc7bf602cd498829b35780623ebe139c0a0483 (diff) | |
download | perl-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.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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) )) |