Skip to content

Commit fef0872

Browse files
committed
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.
1 parent ecb1592 commit fef0872

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

sapi/phpdbg/phpdbg_parser.y

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
3939
%define api.value.type {phpdbg_param_t}
4040
%define parse.error verbose
4141

42+
%token END 0 "end of command"
4243
%token T_EVAL "eval"
4344
%token T_RUN "run"
4445
%token T_SHELL "shell"

sapi/phpdbg/tests/bug76813.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Bug #76813 (Access_violation_near_NULL_on_source_operand)
44
"#!==)===\377\377\276\242="
55
#!==)===\377\377\276\242=
66
--EXPECT--
7-
prompt> [Parse Error: syntax error, unexpected input, expecting $end]
8-
prompt> [Parse Error: syntax error, unexpected # (pound sign), expecting $end]
9-
prompt> [Parse Error: syntax error, unexpected # (pound sign), expecting $end]
7+
prompt> [Parse Error: syntax error, unexpected input, expecting end of command]
8+
prompt> [Parse Error: syntax error, unexpected # (pound sign), expecting end of command]
9+
prompt> [Parse Error: syntax error, unexpected # (pound sign), expecting end of command]
1010
prompt>

0 commit comments

Comments
 (0)