@@ -342,7 +342,7 @@ void zend_oparray_context_begin(zend_oparray_context *prev_context, zend_op_arra
342
342
CG (context ).brk_cont_array = NULL ;
343
343
CG (context ).labels = NULL ;
344
344
CG (context ).in_jmp_frameless_branch = false;
345
- CG (context ).active_property_info = NULL ;
345
+ CG (context ).active_property_info_name = NULL ;
346
346
CG (context ).active_property_hook_kind = (zend_property_hook_kind )- 1 ;
347
347
}
348
348
/* }}} */
@@ -5100,13 +5100,13 @@ static bool zend_compile_parent_property_hook_call(znode *result, zend_ast *ast,
5100
5100
zend_property_hook_kind hook_kind = zend_get_property_hook_kind_from_name (hook_name );
5101
5101
ZEND_ASSERT (hook_kind != (uint32_t )-1 );
5102
5102
5103
- const zend_property_info * prop_info = CG (context ).active_property_info ;
5104
- if (!prop_info ) {
5103
+ const zend_string * prop_info_name = CG (context ).active_property_info_name ;
5104
+ if (!prop_info_name ) {
5105
5105
zend_error_noreturn (E_COMPILE_ERROR , "Must not use parent::$%s::%s() outside a property hook" ,
5106
5106
ZSTR_VAL (property_name ), ZSTR_VAL (hook_name ));
5107
5107
}
5108
5108
5109
- const char * unmangled_prop_name = zend_get_unmangled_property_name (prop_info -> name );
5109
+ const char * unmangled_prop_name = zend_get_unmangled_property_name (prop_info_name );
5110
5110
if (!zend_string_equals_cstr (property_name , unmangled_prop_name , strlen (unmangled_prop_name ))) {
5111
5111
zend_error_noreturn (E_COMPILE_ERROR , "Must not use parent::$%s::%s() in a different property ($%s)" ,
5112
5112
ZSTR_VAL (property_name ), ZSTR_VAL (hook_name ), unmangled_prop_name );
@@ -8242,7 +8242,7 @@ static zend_string *zend_begin_func_decl(znode *result, zend_op_array *op_array,
8242
8242
8243
8243
static zend_op_array * zend_compile_func_decl_ex (
8244
8244
znode * result , zend_ast * ast , enum func_decl_level level ,
8245
- const zend_property_info * property_info ,
8245
+ zend_string * property_info_name ,
8246
8246
zend_property_hook_kind hook_kind
8247
8247
) {
8248
8248
zend_ast_decl * decl = (zend_ast_decl * ) ast ;
@@ -8340,7 +8340,7 @@ static zend_op_array *zend_compile_func_decl_ex(
8340
8340
}
8341
8341
8342
8342
zend_oparray_context_begin (& orig_oparray_context , op_array );
8343
- CG (context ).active_property_info = property_info ;
8343
+ CG (context ).active_property_info_name = property_info_name ;
8344
8344
CG (context ).active_property_hook_kind = hook_kind ;
8345
8345
8346
8346
{
@@ -8557,7 +8557,7 @@ static void zend_compile_property_hooks(
8557
8557
hook -> name = zend_strpprintf (0 , "$%s::%s" , ZSTR_VAL (prop_name ), ZSTR_VAL (name ));
8558
8558
8559
8559
zend_function * func = (zend_function * ) zend_compile_func_decl_ex (
8560
- NULL , (zend_ast * ) hook , FUNC_DECL_LEVEL_NESTED , prop_info , hook_kind );
8560
+ NULL , (zend_ast * ) hook , FUNC_DECL_LEVEL_NESTED , prop_info -> name , hook_kind );
8561
8561
8562
8562
func -> common .prop_info = prop_info ;
8563
8563
@@ -8657,12 +8657,8 @@ static void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t f
8657
8657
zend_type type = ZEND_TYPE_INIT_NONE (0 );
8658
8658
flags |= zend_property_is_virtual (ce , name , hooks_ast , flags ) ? ZEND_ACC_VIRTUAL : 0 ;
8659
8659
8660
- /* FIXME: This is a dirty fix to maintain ABI compatibility. We don't
8661
- * have an actual property info yet, but we really only need the name
8662
- * anyway. We should convert this to a zend_string. */
8663
- ZEND_ASSERT (!CG (context ).active_property_info );
8664
- zend_property_info dummy_prop_info = { .name = name };
8665
- CG (context ).active_property_info = & dummy_prop_info ;
8660
+ ZEND_ASSERT (!CG (context ).active_property_info_name );
8661
+ CG (context ).active_property_info_name = name ;
8666
8662
8667
8663
if (!hooks_ast ) {
8668
8664
if (ce -> ce_flags & ZEND_ACC_INTERFACE ) {
@@ -8757,7 +8753,7 @@ static void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t f
8757
8753
zend_compile_attributes (& info -> attributes , attr_ast , 0 , ZEND_ATTRIBUTE_TARGET_PROPERTY , 0 );
8758
8754
}
8759
8755
8760
- CG (context ).active_property_info = NULL ;
8756
+ CG (context ).active_property_info_name = NULL ;
8761
8757
}
8762
8758
}
8763
8759
/* }}} */
@@ -9613,9 +9609,9 @@ static bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast) /* {{{ */
9613
9609
}
9614
9610
break ;
9615
9611
case T_PROPERTY_C : {
9616
- const zend_property_info * prop_info = CG (context ).active_property_info ;
9617
- if (prop_info ) {
9618
- ZVAL_STR (zv , zend_copy_unmangled_prop_name (prop_info -> name ));
9612
+ zend_string * prop_info_name = CG (context ).active_property_info_name ;
9613
+ if (prop_info_name ) {
9614
+ ZVAL_STR (zv , zend_copy_unmangled_prop_name (prop_info_name ));
9619
9615
} else {
9620
9616
ZVAL_EMPTY_STRING (zv );
9621
9617
}
0 commit comments