In perl.git, the branch maint-5.20 has been updated <http://perl5.git.perl.org/perl.git/commitdiff/c592e125ad8f4bb7476cffed9537213296301364?hp=c0315d9584e14b17b60c94f328964d455a07ada6>
- Log ----------------------------------------------------------------- commit c592e125ad8f4bb7476cffed9537213296301364 Author: Father Chrysostomos <[email protected]> Date: Sun Jan 4 23:18:02 2015 -0800 perldiag: Document âBad symbol for scalarâ Originally this was a separate message in gv.c, with an exception listed in diag.t d5713896ec merged several functions together, changing the exception to âBad symbol for %sâ. bb85b28a added diag_listed_as in the wrong place. de6f7947 moved it to the right place, removing the diag.t entry. But all this time âBad symbol for scalarâ remained undocumented. (cherry picked from commit e6d55c9947dea892b32541479147753415a72c46) M pod/perldiag.pod commit 9ccdaf406c3b6831a477937cf00815dafb7d9cd1 Author: Aristotle Pagaltzis <[email protected]> Date: Tue Dec 2 04:05:20 2014 +0100 perlfunc: document immediate stricture effect of "our" (cherry picked from commit ecafefb82337acf1046f535da14a6fc0293f70b5) M pod/perlfunc.pod commit 0c546e50351fee93b8cc4390c7208927356f042a Author: Hugo van der Sanden <[email protected]> Date: Wed Jan 21 08:55:20 2015 +0000 intuit_more: no need to copy before keyword check That also avoids crashing on overrun. (cherry picked from commit 56f81afc0f2d331537f38e6f12b86a850187cb8a) M t/re/pat.t M toke.c commit b06ace5bb3752d3e5149fd28a2757fc6a69e574e Author: Tony Cook <[email protected]> Date: Mon Jan 19 16:25:33 2015 +1100 perldelta for 62db6ea5fed1 (cherry picked from commit cb6cc22be04ebc9284469880f586341acf15fec5) M pod/perldelta.pod commit fa99b01c21f8239e97ea5fee6e3baf2733472cf5 Author: Tony Cook <[email protected]> Date: Mon Jan 19 16:03:18 2015 +1100 [perl #123538] always set chophere and itembytes at the same time Previously this would crash in FF_MORE because chophere was still NULL. (cherry picked from commit 62db6ea5fed19611596cbc5fc0b8a4df2c604e58) M pp_ctl.c M t/op/write.t ----------------------------------------------------------------------- Summary of changes: pod/perldelta.pod | 7 +++++++ pod/perldiag.pod | 5 +++++ pod/perlfunc.pod | 13 ++++++++++++- pp_ctl.c | 1 + t/op/write.t | 14 +++++++++++++- t/re/pat.t | 11 ++++++++++- toke.c | 7 +++---- 7 files changed, 51 insertions(+), 7 deletions(-) diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 5b10a5c..a4c341b 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -404,6 +404,13 @@ A memory leak in some regular expressions, introduced in Perl 5.20.1, has been fixed. L<[perl #123198]|https://rt.perl.org/Ticket/Display.html?id=123198> +=item * + +C<< formline("@...", "a"); >> would crash. The C<FF_CHECKNL> cas in +pp_formline() didn't set the pointer used to mark the chop position, +which led to the C<FF_MORE> case crashing with a segmentation fault. +This has been fixed. [perl #123538] + =back =head1 Known Problems diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 3c17a14..9f3996f 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -440,6 +440,11 @@ that wasn't a symbol table entry. (P) An internal request asked to add a hash entry to something that wasn't a symbol table entry. +=item Bad symbol for scalar + +(P) An internal request asked to add a scalar entry to something that +wasn't a symbol table entry. + =item Bareword found in conditional (W bareword) The compiler found a bareword where it expected a diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 9a12865..802b990 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -4367,7 +4367,8 @@ existing variable: a package variable of the same name. This means that when C<use strict 'vars'> is in effect, C<our> lets you use a package variable without qualifying it with the package name, but only within -the lexical scope of the C<our> declaration. +the lexical scope of the C<our> declaration. This applies immediately--even +within the same statement. package Foo; use strict; @@ -4393,6 +4394,16 @@ package variables spring into existence when first used. print $Foo::foo; # prints 23 +Because the variable becomes legal immediately under C<use strict 'vars'>, so +long as there is no variable with that name is already in scope, you can then +reference the package variable again even within the same statement. + + package Foo; + use strict; + + my $foo = $foo; # error, undeclared $foo on right-hand side + our $foo = $foo; # no errors + If more than one variable is listed, the list must be placed in parentheses. diff --git a/pp_ctl.c b/pp_ctl.c index 1a86251..11314ec 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -590,6 +590,7 @@ PP(pp_formline) break; } itembytes = s - item; + chophere = s; break; } diff --git a/t/op/write.t b/t/op/write.t index a0172ee..7f0e881 100644 --- a/t/op/write.t +++ b/t/op/write.t @@ -98,7 +98,7 @@ for my $tref ( @NumTests ){ my $bas_tests = 21; # number of tests in section 3 -my $bug_tests = 66 + 3 * 3 * 5 * 2 * 3 + 2 + 66 + 4 + 2 + 3 + 96 + 11 + 2; +my $bug_tests = 66 + 3 * 3 * 5 * 2 * 3 + 2 + 66 + 4 + 2 + 3 + 96 + 11 + 3; # number of tests in section 4 my $hmb_tests = 37; @@ -1960,6 +1960,18 @@ dd| EXPECT { stderr => 1 }, '#123245 different panic in sv_chop'); +fresh_perl_is(<<'EOP', <<'EXPECT', +format STDOUT = +# x at the end to make the spaces visible +@... x +q/a/ +. +write; +EOP +a x +EXPECT + { stderr => 1 }, '#123538 crash in FF_MORE'); + ############################# ## Section 4 ## Add new tests *above* here diff --git a/t/re/pat.t b/t/re/pat.t index a9cb739..7965f4e 100644 --- a/t/re/pat.t +++ b/t/re/pat.t @@ -20,7 +20,7 @@ BEGIN { require './test.pl'; } -plan tests => 724; # Update this when adding/deleting tests. +plan tests => 726; # Update this when adding/deleting tests. run_tests() unless caller; @@ -1593,6 +1593,15 @@ EOP like("TffffffffffffT\x{100}TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT5TTTTTTTTTTTTTTTTTTTTTTTTT3TTgTTTTTTTTTTTTTTTTTTTTT2TTTTTTTTTTTTTTTTTTTTTTTHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH ... [652 chars truncated] } + { # [perl #123604] + my($s, $x, @x) = ('abc', 'a', 'd'); + my $long = 'b' x 2000; + my $eval = q{$s =~ m{$x[bbb]c} ? 1 : 0}; + $eval =~ s{bbb}{$long}; + my $match = eval $eval; + ok(1, "did not crash"); + ok($match, "[bbb...] resolved as character class, not subscript"); + } } # End of sub run_tests 1; diff --git a/toke.c b/toke.c index 5af680d..906d56c 100644 --- a/toke.c +++ b/toke.c @@ -4072,11 +4072,10 @@ S_intuit_more(pTHX_ char *s) && !(last_un_char == '$' || last_un_char == '@' || last_un_char == '&') && isALPHA(*s) && s[1] && isALPHA(s[1])) { - char *d = tmpbuf; + char *d = s; while (isALPHA(*s)) - *d++ = *s++; - *d = '\0'; - if (keyword(tmpbuf, d - tmpbuf, 0)) + s++; + if (keyword(d, s - d, 0)) weight -= 150; } if (un_char == last_un_char + 1) -- Perl5 Master Repository
