Fix -Wuseless-escape warnings emitted by re2c (#19050)

re2c version 4 enabled some warnings by default. This fixes re2c code
for the `-Wuseless-escape` warnings.

There are two same issues reported.
Issue: GH-17523
Closes: GH-17204
This commit is contained in:
Peter Kokot 2025-07-07 09:51:25 +02:00 committed by GitHub
parent 405be1c940
commit 258fbd6bf9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 6 deletions

1
NEWS
View file

@ -10,6 +10,7 @@ PHP NEWS
order). (Daniil Gentili)
. Fix OSS-Fuzz #427814456. (nielsdos)
. Fix OSS-Fuzz #428983568 and #428760800. (nielsdos)
. Fixed bug GH-17204 -Wuseless-escape warnings emitted by re2c. (Peter Kokot)
- Curl:
. Fix memory leaks when returning refcounted value from curl callback.

View file

@ -352,16 +352,16 @@ restart:
/*!re2c
re2c:yyfill:check = 0;
LNUM [0-9]+
DNUM ([0-9]*[\.][0-9]+)|([0-9]+[\.][0-9]*)
DNUM ([0-9]*[.][0-9]+)|([0-9]+[.][0-9]*)
NUMBER [-]?{LNUM}|{DNUM}
ANY_CHAR (.|[\n\t])
NEWLINE ("\r"|"\n"|"\r\n")
TABS_AND_SPACES [ \t]
WHITESPACE [ \t]+
CONSTANT [a-zA-Z_][a-zA-Z0-9_]*
LABEL_CHAR [^=\n\r\t;&|^$~(){}!"\[\]\x00]
LABEL_CHAR [^=\n\r\t;&|^$~(){}!"[\]\x00]
LABEL ({LABEL_CHAR}+)
TOKENS [:,.\[\]"'()&|^+-/*=%$!~<>?@{}]
TOKENS [:,.[\]"'()&|^+-/*=%$!~<>?@{}]
OPERATORS [&|^~()!]
DOLLAR_CURLY "${"

View file

@ -1801,11 +1801,11 @@ OPTIONAL_WHITESPACE_OR_COMMENTS ({WHITESPACE}|{MULTI_LINE_COMMENT}|{SINGLE_LINE_
RETURN_TOKEN(T_MUL_EQUAL);
}
<ST_IN_SCRIPTING>"*\*" {
<ST_IN_SCRIPTING>"**" {
RETURN_TOKEN(T_POW);
}
<ST_IN_SCRIPTING>"*\*=" {
<ST_IN_SCRIPTING>"**=" {
RETURN_TOKEN(T_POW_EQUAL);
}

View file

@ -77,7 +77,7 @@ T_IF 'if'
T_RUN 'run'
T_RUN_SHORT "r"
WS [ \r\t]+
DIGITS [-]?[0-9\.]+
DIGITS [-]?[0-9.]+
ID [^ \r\n\t:#\000]+
GENERIC_ID ([^ \r\n\t:#\000"']|":\\")+|["]([^\n\000"\\]|"\\\\"|"\\"["])+["]|[']([^\n\000'\\]|"\\\\"|"\\"['])+[']
ADDR [0][x][a-fA-F0-9]+