In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/71776ae4fad9a7659deefe0c2376d45b873ffd6a?hp=3c157b3cf0631c69ffa5aa2d55b9199bf93b22a9>

- Log -----------------------------------------------------------------
commit 71776ae4fad9a7659deefe0c2376d45b873ffd6a
Author: Tony Cook <[email protected]>
Date:   Tue Jan 24 11:14:28 2017 +1100

    (perl #129274) avoid treating the # in $# as a comment intro
-----------------------------------------------------------------------

Summary of changes:
 t/op/lex.t | 14 +++++++++++++-
 toke.c     |  4 +++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/t/op/lex.t b/t/op/lex.t
index e50f0ebb65..c8ecf36cf2 100644
--- a/t/op/lex.t
+++ b/t/op/lex.t
@@ -7,7 +7,7 @@ use warnings;
 
 BEGIN { chdir 't' if -d 't'; require './test.pl'; }
 
-plan(tests => 34);
+plan(tests => 35);
 
 {
     no warnings 'deprecated';
@@ -273,3 +273,15 @@ SKIP:
         '[perl #129000] read before buffer'
     );
 }
+# probably only failed under ASAN
+fresh_perl_is(
+    "stat\tt\$#0",
+    <<'EOM',
+$# is no longer supported. Its use will be fatal in Perl 5.30 at - line 1.
+Number found where operator expected at - line 1, near "$#0"
+       (Missing operator before 0?)
+Can't call method "t" on an undefined value at - line 1.
+EOM
+    {},
+    "[perl #129273] heap use after free or overflow"
+);
diff --git a/toke.c b/toke.c
index 10669de57d..ca06b7a3ab 100644
--- a/toke.c
+++ b/toke.c
@@ -4279,7 +4279,9 @@ S_intuit_method(pTHX_ char *start, SV *ioname, CV *cv)
        if (cv || PL_last_lop_op == OP_PRINT || PL_last_lop_op == OP_SAY
             || isUPPER(*PL_tokenbuf))
            return 0;
-       s = skipspace(s);
+        /* this could be $# */
+        if (isSPACE(*s))
+            s = skipspace(s);
        PL_bufptr = start;
        PL_expect = XREF;
        return *s == '(' ? FUNCMETH : METHOD;

--
Perl5 Master Repository

Reply via email to