From fef08723c1b584f69cbd164cf6557f680f2bc158 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 2 Dec 2020 10:40:57 +0100 Subject: [PATCH] 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. --- sapi/phpdbg/phpdbg_parser.y | 1 + sapi/phpdbg/tests/bug76813.phpt | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) 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> -- 2.50.1