In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/c9470cf1abc4cc21f63ba5222f7860ec1175adfc?hp=f8def6c7f38b614db0e8ac0ba76999e9b8cfd1d6>

- Log -----------------------------------------------------------------
commit c9470cf1abc4cc21f63ba5222f7860ec1175adfc
Author: Karl Williamson <[email protected]>
Date:   Wed Feb 1 13:15:00 2017 -0700

    toke.c: Remove unused param from static function
    
    Commit d2067945159644d284f8064efbd41024f9e8448a reverted commit
    b5248d1e210c2a723adae8e9b7f5d17076647431.  b5248 removed a parameter
    from S_scan_ident, and changed its interior to use PL_bufend instead of
    that parameter.  The parameter had been used to limit how far into the
    string being parsed scan_ident could look.  In all calls to scan_ident
    but one, the parameter was already PL_bufend.  In the one call where it
    wasn't, b5248 compensated by temporarily changing PL_bufend around the
    call, running afoul, eventually, of the expectation that PL_bufend
    points to a NUL.
    
    I would have expected the reversion to add back both the parameter and
    the uses of it, but apparently the function interior has changed enough
    since the original commit, that it didn't even think there were
    conflicts.  As a result the parameter got added back, but not the uses
    of it.
    
    I tried both approaches to fix this:
        1) to change the function to use the parameter;
        2) to simply delete the parameter.
    Only the latter passed the test suite without error.
    
    I then tried to understand why the parameter in the first place, and why
    the kludge introduced by b5248 to work around removing it.  It appears
    to me that this is for the benefit of the intuit_more function to enable
    it to discern $] from a $ ending a bracketed character class, by ending
    the scan before the ']' when in a pattern.
    
    The trouble is that modern scan_ident versions do not view themselves as
    constrained by PL_bufend.  If that is reached at a point where white
    space is allowed, it will try appending the next input line and
    continuing, thus changing PL_bufend.  Thus the kludge in b5248 wouldn't
    necessarily do the expected limiting anyway.  The reason the approach
    "1)" I tried didn't work was that the function continued to use the
    original value, even after it had read in new things, instead of
    accounting for those.
    
    Hence approach "2)" is used.  I'm a little nervous about this, as it may
    lead to intuit_more() (which uses heuristics) having more cases where it
    makes the wrong choice about $] vs [...$].  But I don't see a way around
    this, and the pre-existing code could fail anyway.
    
    Spotted by Dave Mitchell.

M       embed.fnc
M       embed.h
M       proto.h
M       toke.c

commit 720a74f8122cba995eee9ee7761fcc3275387435
Author: Karl Williamson <[email protected]>
Date:   Tue Jan 31 15:17:56 2017 -0700

    t/lib/warnings/toke: Fix comment typos

M       t/lib/warnings/toke
-----------------------------------------------------------------------

Summary of changes:
 embed.fnc           |  2 +-
 embed.h             |  2 +-
 proto.h             |  4 ++--
 t/lib/warnings/toke |  6 +++---
 toke.c              | 19 ++++++++-----------
 5 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/embed.fnc b/embed.fnc
index d84f31353b..d548f5d5e5 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -2645,7 +2645,7 @@ sR        |SV*    |get_and_check_backslash_N_name|NN 
const char* s \
                                |NN const char* const e
 sR     |char*  |scan_formline  |NN char *s
 sR     |char*  |scan_heredoc   |NN char *s
-s      |char*  |scan_ident     |NN char *s|NN const char *send|NN char *dest \
+s      |char*  |scan_ident     |NN char *s|NN char *dest       \
                                |STRLEN destlen|I32 ck_uni
 sR     |char*  |scan_inputsymbol|NN char *start
 sR     |char*  |scan_pat       |NN char *start|I32 type
diff --git a/embed.h b/embed.h
index 72950ae44b..2233a35e80 100644
--- a/embed.h
+++ b/embed.h
@@ -1815,7 +1815,7 @@
 #define scan_const(a)          S_scan_const(aTHX_ a)
 #define scan_formline(a)       S_scan_formline(aTHX_ a)
 #define scan_heredoc(a)                S_scan_heredoc(aTHX_ a)
-#define scan_ident(a,b,c,d,e)  S_scan_ident(aTHX_ a,b,c,d,e)
+#define scan_ident(a,b,c,d)    S_scan_ident(aTHX_ a,b,c,d)
 #define scan_inputsymbol(a)    S_scan_inputsymbol(aTHX_ a)
 #define scan_pat(a,b)          S_scan_pat(aTHX_ a,b)
 #define scan_str(a,b,c,d,e)    S_scan_str(aTHX_ a,b,c,d,e)
diff --git a/proto.h b/proto.h
index 46556eec17..7ec784981a 100644
--- a/proto.h
+++ b/proto.h
@@ -5552,9 +5552,9 @@ STATIC char*      S_scan_heredoc(pTHX_ char *s)
 #define PERL_ARGS_ASSERT_SCAN_HEREDOC  \
        assert(s)
 
-STATIC char*   S_scan_ident(pTHX_ char *s, const char *send, char *dest, 
STRLEN destlen, I32 ck_uni);
+STATIC char*   S_scan_ident(pTHX_ char *s, char *dest, STRLEN destlen, I32 
ck_uni);
 #define PERL_ARGS_ASSERT_SCAN_IDENT    \
-       assert(s); assert(send); assert(dest)
+       assert(s); assert(dest)
 STATIC char*   S_scan_inputsymbol(pTHX_ char *start)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_SCAN_INPUTSYMBOL      \
diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke
index 8ed6177c39..c97abafecd 100644
--- a/t/lib/warnings/toke
+++ b/t/lib/warnings/toke
@@ -1621,7 +1621,7 @@ my $a = qr ̂foobar̂;
 EXPECT
 Use of unassigned code point or non-standalone grapheme for a delimiter will 
be a fatal error starting in Perl 5.30 at - line 8.
 ########
-# NAME  [perl $130567] Assertion failure
+# NAME  [perl #130567] Assertion failure
 BEGIN {
     if (ord('A') != 65) {
         print "SKIPPED\n# test is ASCII-specific";
@@ -1635,12 +1635,12 @@ s//"\x{180};;s\221(*$@$`\241\275";/gee;
 s//"s\221\302\302\302\302\302\302\302$@\241\275";/gee;
 EXPECT
 ########
-# NAME  [perl $130666] Assertion failure
+# NAME  [perl #130666] Assertion failure
 no warnings "uninitialized";
 BEGIN{$^H=-1};my $l; s$0[$l]
 EXPECT
 ########
-# NAME  [perl $129036] Assertion failure
+# NAME  [perl #129036] Assertion failure
 BEGIN{$0="";$^H=hex join""=>A00000}p?
 EXPECT
 OPTION fatal
diff --git a/toke.c b/toke.c
index b9096b033f..d529f03b72 100644
--- a/toke.c
+++ b/toke.c
@@ -4179,7 +4179,7 @@ S_intuit_more(pTHX_ char *s)
                weight -= seen[un_char] * 10;
                if (isWORDCHAR_lazy_if_safe(s+1, PL_bufend, UTF)) {
                    int len;
-                   scan_ident(s, send, tmpbuf, sizeof tmpbuf, FALSE);
+                   scan_ident(s, tmpbuf, sizeof tmpbuf, FALSE);
                    len = (int)strlen(tmpbuf);
                    if (len > 1 && gv_fetchpvn_flags(tmpbuf, len,
                                                     UTF ? SVf_UTF8 : 0, 
SVt_PV))
@@ -5703,7 +5703,7 @@ Perl_yylex(pTHX)
     case '*':
        if (PL_expect == XPOSTDEREF) POSTDEREF('*');
        if (PL_expect != XOPERATOR) {
-           s = scan_ident(s, PL_bufend, PL_tokenbuf, sizeof PL_tokenbuf, TRUE);
+           s = scan_ident(s, PL_tokenbuf, sizeof PL_tokenbuf, TRUE);
            PL_expect = XOPERATOR;
            force_ident(PL_tokenbuf, '*');
            if (!*PL_tokenbuf)
@@ -5746,8 +5746,7 @@ Perl_yylex(pTHX)
        }
        else if (PL_expect == XPOSTDEREF) POSTDEREF('%');
        PL_tokenbuf[0] = '%';
-       s = scan_ident(s, PL_bufend, PL_tokenbuf + 1,
-               sizeof PL_tokenbuf - 1, FALSE);
+       s = scan_ident(s, PL_tokenbuf + 1, sizeof PL_tokenbuf - 1, FALSE);
        pl_yylval.ival = 0;
        if (!PL_tokenbuf[1]) {
            PREREF('%');
@@ -6293,8 +6292,7 @@ Perl_yylex(pTHX)
        }
 
        PL_tokenbuf[0] = '&';
-       s = scan_ident(s - 1, PL_bufend, PL_tokenbuf + 1,
-                      sizeof PL_tokenbuf - 1, TRUE);
+       s = scan_ident(s - 1, PL_tokenbuf + 1, sizeof PL_tokenbuf - 1, TRUE);
        pl_yylval.ival = (OPpENTERSUB_AMPER<<8);
        if (PL_tokenbuf[1]) {
            force_ident_maybe_lex('&');
@@ -6556,7 +6554,7 @@ Perl_yylex(pTHX)
                 || strchr("{$:+-@", s[2])))
         {
            PL_tokenbuf[0] = '@';
-           s = scan_ident(s + 1, PL_bufend, PL_tokenbuf + 1,
+           s = scan_ident(s + 1, PL_tokenbuf + 1,
                           sizeof PL_tokenbuf - 1, FALSE);
             if (PL_expect == XOPERATOR) {
                 d = s;
@@ -6574,8 +6572,7 @@ Perl_yylex(pTHX)
        }
 
        PL_tokenbuf[0] = '$';
-       s = scan_ident(s, PL_bufend, PL_tokenbuf + 1,
-                      sizeof PL_tokenbuf - 1, FALSE);
+       s = scan_ident(s, PL_tokenbuf + 1, sizeof PL_tokenbuf - 1, FALSE);
        if (PL_expect == XOPERATOR) {
            d = s;
            if (PL_bufptr > s) {
@@ -6710,7 +6707,7 @@ Perl_yylex(pTHX)
         if (PL_expect == XPOSTDEREF)
             POSTDEREF('@');
        PL_tokenbuf[0] = '@';
-       s = scan_ident(s, PL_bufend, PL_tokenbuf + 1, sizeof PL_tokenbuf - 1, 
FALSE);
+       s = scan_ident(s, PL_tokenbuf + 1, sizeof PL_tokenbuf - 1, FALSE);
        if (PL_expect == XOPERATOR) {
             d = s;
             if (PL_bufptr > s) {
@@ -9270,7 +9267,7 @@ S_scan_word(pTHX_ char *s, char *dest, STRLEN destlen, 
int allow_package, STRLEN
                             && LIKELY((U8) *(s) != LATIN1_TO_NATIVE(0xAD)))))
 
 STATIC char *
-S_scan_ident(pTHX_ char *s, const char *send, char *dest, STRLEN destlen, I32 
ck_uni)
+S_scan_ident(pTHX_ char *s, char *dest, STRLEN destlen, I32 ck_uni)
 {
     I32 herelines = PL_parser->herelines;
     SSize_t bracket = -1;

--
Perl5 Master Repository

Reply via email to