diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-09-24 20:33:47 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-09-24 20:33:47 -0700 |
commit | 9138d6cae0eac4fc349c2e253e64077481cf6a49 (patch) | |
tree | 8b96e7e173029e1e6364a1dd9df5edf75279962d | |
parent | a9984b10c8213b2dc4345882bd808798485d584c (diff) | |
download | perl-9138d6cae0eac4fc349c2e253e64077481cf6a49.tar.gz |
[perl #76814] FETCH called twice - y
This patch stops y from calling get-magic twice. (This has caused
double magick since as far back as 5.6.2.)
-rw-r--r-- | doop.c | 12 | ||||
-rw-r--r-- | t/op/tie_fetch_count.t | 5 |
2 files changed, 7 insertions, 10 deletions
@@ -33,7 +33,7 @@ S_do_trans_simple(pTHX_ SV * const sv) dVAR; I32 matches = 0; STRLEN len; - U8 *s = (U8*)SvPV(sv,len); + U8 *s = (U8*)SvPV_nomg(sv,len); U8 * const send = s+len; const short * const tbl = (short*)cPVOP->op_pv; @@ -101,7 +101,7 @@ S_do_trans_count(pTHX_ SV * const sv) { dVAR; STRLEN len; - const U8 *s = (const U8*)SvPV_const(sv, len); + const U8 *s = (const U8*)SvPV_nomg_const(sv, len); const U8 * const send = s + len; I32 matches = 0; const short * const tbl = (short*)cPVOP->op_pv; @@ -139,7 +139,7 @@ S_do_trans_complex(pTHX_ SV * const sv) { dVAR; STRLEN len; - U8 *s = (U8*)SvPV(sv, len); + U8 *s = (U8*)SvPV_nomg(sv, len); U8 * const send = s+len; I32 matches = 0; const short * const tbl = (short*)cPVOP->op_pv; @@ -325,7 +325,7 @@ S_do_trans_simple_utf8(pTHX_ SV * const sv) PERL_ARGS_ASSERT_DO_TRANS_SIMPLE_UTF8; - s = (U8*)SvPV(sv, len); + s = (U8*)SvPV_nomg(sv, len); if (!SvUTF8(sv)) { const U8 *t = s; const U8 * const e = s + len; @@ -426,7 +426,7 @@ S_do_trans_count_utf8(pTHX_ SV * const sv) PERL_ARGS_ASSERT_DO_TRANS_COUNT_UTF8; - s = (const U8*)SvPV_const(sv, len); + s = (const U8*)SvPV_nomg_const(sv, len); if (!SvUTF8(sv)) { const U8 *t = s; const U8 * const e = s + len; @@ -478,7 +478,7 @@ S_do_trans_complex_utf8(pTHX_ SV * const sv) STRLEN len; U8 *dstart, *dend; U8 hibit = 0; - U8 *s = (U8*)SvPV(sv, len); + U8 *s = (U8*)SvPV_nomg(sv, len); PERL_ARGS_ASSERT_DO_TRANS_COMPLEX_UTF8; diff --git a/t/op/tie_fetch_count.t b/t/op/tie_fetch_count.t index 1509e2d995..a5e652e26b 100644 --- a/t/op/tie_fetch_count.t +++ b/t/op/tie_fetch_count.t @@ -143,10 +143,7 @@ $_ = "foo"; $dummy = $var =~ m/ / ; check_count 'm//'; $dummy = $var =~ s/ //; check_count 's///'; $dummy = $var ~~ 1 ; check_count '~~'; -TODO: { - local $::TODO = $TODO; - $dummy = $var =~ y/ //; check_count 'y///'; -} +$dummy = $var =~ y/ //; check_count 'y///'; /$var/ ; check_count 'm/pattern/'; /$var foo/ ; check_count 'm/$tied foo/'; s/$var// ; check_count 's/pattern//'; |