From: Nikita Popov Date: Wed, 2 Dec 2020 09:40:57 +0000 (+0100) Subject: Ensure consistent error message in phpdbg parser X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fef08723c1b584f69cbd164cf6557f680f2bc158;p=php Ensure consistent error message in phpdbg parser This would be either $end or "end of file" depending on bison version. Explicitly specify "end of command" instead, which seems more appropriate in context. --- diff --git a/sapi/phpdbg/phpdbg_parser.y b/sapi/phpdbg/phpdbg_parser.y index cdfe92570e..2953b3bcce 100644 --- a/sapi/phpdbg/phpdbg_parser.y +++ b/sapi/phpdbg/phpdbg_parser.y @@ -39,6 +39,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg) %define api.value.type {phpdbg_param_t} %define parse.error verbose +%token END 0 "end of command" %token T_EVAL "eval" %token T_RUN "run" %token T_SHELL "shell" diff --git a/sapi/phpdbg/tests/bug76813.phpt b/sapi/phpdbg/tests/bug76813.phpt index 61e5e3fea6..67a51d7316 100644 --- a/sapi/phpdbg/tests/bug76813.phpt +++ b/sapi/phpdbg/tests/bug76813.phpt @@ -4,7 +4,7 @@ Bug #76813 (Access_violation_near_NULL_on_source_operand) "#!==)===\377\377\276\242=" #!==)===\377\377\276\242= --EXPECT-- -prompt> [Parse Error: syntax error, unexpected input, expecting $end] -prompt> [Parse Error: syntax error, unexpected # (pound sign), expecting $end] -prompt> [Parse Error: syntax error, unexpected # (pound sign), expecting $end] +prompt> [Parse Error: syntax error, unexpected input, expecting end of command] +prompt> [Parse Error: syntax error, unexpected # (pound sign), expecting end of command] +prompt> [Parse Error: syntax error, unexpected # (pound sign), expecting end of command] prompt>