diff --git a/Zend/tests/halt_compiler5.phpt b/Zend/tests/halt_compiler5.phpt new file mode 100644 index 00000000000..71d973e4f7e --- /dev/null +++ b/Zend/tests/halt_compiler5.phpt @@ -0,0 +1,8 @@ +--TEST-- +Using __COMPILER_HALF_OFFSET__ with trailing {} (OSS-Fuzz #17895) +--FILE-- +kind == ZEND_AST_STMT_LIST) { zend_ast_list *list = zend_ast_get_list(last); + if (list->children == 0) { + break; + } last = list->child[list->children-1]; } if (last && last->kind == ZEND_AST_HALT_COMPILER) {