From 95a13ca989d8b1624eb6439d662723c026ac11e8 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 11 Jan 2021 13:10:47 +0100 Subject: Revert fix for bug 76813 and re2c version bump CentOS 7 ships with re2c 0.13.5 by default, so we should not have bumped the required re2c version to 0.13.7. However, 0.13.5 does not support default rules, so we cannot use them to fix bug 76813. This reverts commit 420184ad529443182c9a348a55b1c9216005c613 and 5e15c9c41f8318a8392c2e2c78544f218736549c. Closes GH-6593. --- NEWS | 3 +++ configure.ac | 2 +- sapi/phpdbg/phpdbg_lexer.l | 6 +----- sapi/phpdbg/phpdbg_parser.y | 8 ++------ sapi/phpdbg/tests/bug76813.phpt | 10 ---------- 5 files changed, 7 insertions(+), 22 deletions(-) delete mode 100644 sapi/phpdbg/tests/bug76813.phpt diff --git a/NEWS b/NEWS index 69aa04f375..1b9fd953a4 100644 --- a/NEWS +++ b/NEWS @@ -44,6 +44,9 @@ PHP NEWS (david at bamsoftware, cmb) . Fixed bug #77565 (Incorrect locator detection in ZIP-based phars). (cmb) +- Phpdbg: + . Reverted fix for bug #76813 (Access violation near NULL on source operand). + (cmb) 07 Jan 2021, PHP 8.0.1 diff --git a/configure.ac b/configure.ac index e77708b9ef..91e6ce16fe 100644 --- a/configure.ac +++ b/configure.ac @@ -154,7 +154,7 @@ PHP_RUNPATH_SWITCH dnl Checks for some support/generator progs. PHP_PROG_AWK PHP_PROG_BISON([3.0.0]) -PHP_PROG_RE2C([0.13.7]) +PHP_PROG_RE2C([0.13.4]) PHP_ARG_ENABLE([re2c-cgoto], [whether to enable computed goto gcc extension with re2c], diff --git a/sapi/phpdbg/phpdbg_lexer.l b/sapi/phpdbg/phpdbg_lexer.l index e57702ba0b..422cda4f2c 100644 --- a/sapi/phpdbg/phpdbg_lexer.l +++ b/sapi/phpdbg/phpdbg_lexer.l @@ -33,7 +33,7 @@ void phpdbg_init_lexer (phpdbg_param_t *stack, char *input) { YYSETCONDITION(INITIAL); - LEX(text) = YYCURSOR = YYMARKER = (unsigned char *) input; + LEX(text) = YYCURSOR = (unsigned char *) input; LEX(len) = strlen(input); } @@ -165,10 +165,6 @@ INPUT ("\\"[#"']|["]("\\\\"|"\\"["]|[^\n\000"])+["]|[']("\\"[']|"\\\\"|[^\ return T_ID; } -* { - return T_UNEXPECTED; -} - {INPUT} { phpdbg_init_param(yylval, STR_PARAM); yylval->str = estrdup(yytext); diff --git a/sapi/phpdbg/phpdbg_parser.y b/sapi/phpdbg/phpdbg_parser.y index cdfe92570e..f776586810 100644 --- a/sapi/phpdbg/phpdbg_parser.y +++ b/sapi/phpdbg/phpdbg_parser.y @@ -63,13 +63,9 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg) %% /* Rules */ input - : non_empty_input { $$ = $1; } - | %empty - ; - -non_empty_input : command { $$ = $1; } - | non_empty_input T_SEPARATOR command { phpdbg_stack_separate($1.top); $$ = $3; } + | input T_SEPARATOR command { phpdbg_stack_separate($1.top); $$ = $3; } + | %empty ; command diff --git a/sapi/phpdbg/tests/bug76813.phpt b/sapi/phpdbg/tests/bug76813.phpt deleted file mode 100644 index 61e5e3fea6..0000000000 --- a/sapi/phpdbg/tests/bug76813.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Bug #76813 (Access_violation_near_NULL_on_source_operand) ---PHPDBG-- -"#!==)===\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> -- cgit v1.2.1