@@ -1088,6 +1088,9 @@ static size_t ZEND_FASTCALL zend_ast_tree_size(zend_ast *ast)
10881088 size += zend_ast_tree_size (list -> child [i ]);
10891089 }
10901090 }
1091+ } else if (zend_ast_is_decl (ast )) {
1092+ /* Not implemented. */
1093+ ZEND_UNREACHABLE ();
10911094 } else {
10921095 uint32_t i , children = zend_ast_get_num_children (ast );
10931096
@@ -1141,6 +1144,9 @@ static void* ZEND_FASTCALL zend_ast_tree_copy(zend_ast *ast, void *buf)
11411144 ZVAL_COPY (& new -> val , & ((zend_ast_zval * ) ast )-> val );
11421145 Z_LINENO (new -> val ) = zend_ast_get_lineno (ast );
11431146 buf = (void * )((char * )buf + sizeof (zend_ast_zval ));
1147+ } else if (zend_ast_is_decl (ast )) {
1148+ /* Not implemented. */
1149+ ZEND_UNREACHABLE ();
11441150 } else {
11451151 uint32_t i , children = zend_ast_get_num_children (ast );
11461152 zend_ast * new = (zend_ast * )buf ;
@@ -1206,7 +1212,7 @@ ZEND_API void ZEND_FASTCALL zend_ast_destroy(zend_ast *ast)
12061212 zend_string_release_ex (zend_ast_get_constant_name (ast ), 0 );
12071213 } else if (EXPECTED (ast -> kind == ZEND_AST_OP_ARRAY )) {
12081214 ZEND_ASSERT (!Z_REFCOUNTED (((zend_ast_zval * )(ast ))-> val ));
1209- } else if (EXPECTED (ast -> kind >= ZEND_AST_FUNC_DECL )) {
1215+ } else if (EXPECTED (zend_ast_is_decl ( ast ) )) {
12101216 zend_ast_decl * decl = (zend_ast_decl * ) ast ;
12111217
12121218 if (decl -> name ) {
@@ -1237,6 +1243,9 @@ ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn, void *contex
12371243 for (i = 0 ; i < list -> children ; ++ i ) {
12381244 fn (& list -> child [i ], context );
12391245 }
1246+ } else if (zend_ast_is_decl (ast )) {
1247+ /* Not implemented. */
1248+ ZEND_UNREACHABLE ();
12401249 } else {
12411250 uint32_t i , children = zend_ast_get_num_children (ast );
12421251 for (i = 0 ; i < children ; ++ i ) {
0 commit comments