@@ -6943,14 +6943,6 @@ static void zend_find_minimal_implicit_binds(closure_info *info, zend_op_array *
6943
6943
continue ;
6944
6944
}
6945
6945
6946
- if (!op_array -> static_variables ) {
6947
- op_array -> static_variables = zend_new_array (8 );
6948
- }
6949
-
6950
- if (!zend_hash_add (op_array -> static_variables , var_name , & EG (uninitialized_zval ))) {
6951
- continue ;
6952
- }
6953
-
6954
6946
zend_hash_add_empty_element (& min_uses , var_name );
6955
6947
}
6956
6948
} ZEND_BITSET_FOREACH_END ();
@@ -6977,7 +6969,9 @@ static void zend_compile_implicit_lexical_binds(
6977
6969
6978
6970
ZEND_HASH_MAP_FOREACH_STR_KEY (& info -> uses , var_name )
6979
6971
zval * value = zend_hash_find (op_array -> static_variables , var_name );
6980
- ZEND_ASSERT (value );
6972
+ if (!value ) {
6973
+ continue ;
6974
+ }
6981
6975
6982
6976
uint32_t offset = (uint32_t )((char * )value - (char * )op_array -> static_variables -> arData );
6983
6977
@@ -7028,16 +7022,18 @@ static void zend_compile_implicit_closure_uses(closure_info *info, zend_op_array
7028
7022
return ;
7029
7023
}
7030
7024
7031
- ZEND_ASSERT (op_array -> static_variables );
7032
-
7033
7025
zend_string * var_name ;
7034
7026
ZEND_HASH_MAP_FOREACH_STR_KEY (& info -> uses , var_name )
7035
- zval * value = zend_hash_find (op_array -> static_variables , var_name );
7036
- zend_op * opline ;
7027
+ if (!op_array -> static_variables ) {
7028
+ op_array -> static_variables = zend_new_array (8 );
7029
+ }
7037
7030
7038
- ZEND_ASSERT (value );
7031
+ zval * value = zend_hash_add (op_array -> static_variables , var_name , & EG (uninitialized_zval ));
7032
+ if (!value ) {
7033
+ continue ;
7034
+ }
7039
7035
7040
- opline = & op_array -> opcodes [opnum ];
7036
+ zend_op * opline = & op_array -> opcodes [opnum ];
7041
7037
opline -> opcode = ZEND_BIND_STATIC ;
7042
7038
opline -> op1_type = IS_CV ;
7043
7039
opline -> op1 .var = lookup_cv (var_name );
@@ -7316,8 +7312,10 @@ static void zend_compile_func_decl(znode *result, zend_ast *ast, bool toplevel)
7316
7312
pass_two (CG (active_op_array ));
7317
7313
7318
7314
if (decl -> kind == ZEND_AST_ARROW_FUNC || decl -> kind == ZEND_AST_SHORT_CLOSURE ) {
7319
- /* Depends on pass_two() */
7320
- zend_find_minimal_implicit_binds (& info , op_array );
7315
+ if (decl -> kind == ZEND_AST_SHORT_CLOSURE ) {
7316
+ /* Depends on pass_two() */
7317
+ zend_find_minimal_implicit_binds (& info , op_array );
7318
+ }
7321
7319
zend_compile_implicit_closure_uses (& info , op_array , opnum_bind );
7322
7320
}
7323
7321
0 commit comments