From ab5295fadb3911bcb5f6a9b1c6addf06d10b3ea4 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 2 Sep 2020 09:09:41 +0200 Subject: add patch for 8.0.0beta3 from https://github.com/nikic/php-ast/pull/174 --- 174.patch | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 174.patch (limited to '174.patch') diff --git a/174.patch b/174.patch new file mode 100644 index 0000000..9c391bf --- /dev/null +++ b/174.patch @@ -0,0 +1,38 @@ +From 1c0d5b08852e1fd69ad7110f4cae53ecac26de3c Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 2 Sep 2020 09:01:23 +0200 +Subject: [PATCH] fix for 8.0.0beta3 + +--- + ast.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +diff --git a/ast.c b/ast.c +index eeb6b5a..2004d7d 100644 +--- a/ast.c ++++ b/ast.c +@@ -329,16 +329,15 @@ static zend_ast *get_ast(zend_string *code, zend_arena **ast_arena, char *filena + CG(in_compilation) = 1; + + zend_save_lexical_state(&original_lex_state); +- if (zend_prepare_string_for_scanning(&code_zv, filename) == SUCCESS) { ++ zend_prepare_string_for_scanning(&code_zv, filename); ++ CG(ast) = NULL; ++ CG(ast_arena) = zend_arena_create(1024 * 32); ++ LANG_SCNG(yy_state) = yycINITIAL; ++ ++ if (zendparse() != 0) { ++ zend_ast_destroy(CG(ast)); ++ zend_arena_destroy(CG(ast_arena)); + CG(ast) = NULL; +- CG(ast_arena) = zend_arena_create(1024 * 32); +- LANG_SCNG(yy_state) = yycINITIAL; +- +- if (zendparse() != 0) { +- zend_ast_destroy(CG(ast)); +- zend_arena_destroy(CG(ast_arena)); +- CG(ast) = NULL; +- } + } + + /* restore_lexical_state changes CG(ast) and CG(ast_arena) */ -- cgit