]> granicus.if.org Git - php/commitdiff
Don't use yystrlen()
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 13 Jan 2020 10:23:30 +0000 (11:23 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 13 Jan 2020 10:23:30 +0000 (11:23 +0100)
This is unnecessary and not available when GLR is used.

Zend/zend_language_parser.y

index 57e88e630dee6e020a90609aabf7e8c25e591dba..f501527740598444d192e67a14ff52fb53fa5cc6 100644 (file)
@@ -1355,7 +1355,7 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
 
                str = LANG_SCNG(yy_text);
                end = memchr(str, '\n', LANG_SCNG(yy_leng));
-               yystr_len = (unsigned int)yystrlen(yystr);
+               yystr_len = (unsigned int)strlen(yystr);
 
                if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
                        && (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
@@ -1383,7 +1383,7 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
 
        /* One of the expected tokens */
        if (!yyres) {
-               return yystrlen(yystr) - (*yystr == '"' ? 2 : 0);
+               return strlen(yystr) - (*yystr == '"' ? 2 : 0);
        }
 
        if (*yystr == '"') {