@@ -9037,7 +9037,10 @@ static void zend_compile_use_trait(zend_ast *ast) /* {{{ */
9037
9037
}
9038
9038
/* }}} */
9039
9039
9040
-
9040
+ static void zend_associated_table_ht_dtor (zval * val ) {
9041
+ /* NO OP as we only use it to be able to refer and save pointers to zend_types */
9042
+ // TODO do we actually want to store copies of types?
9043
+ }
9041
9044
9042
9045
static void zend_compile_associated_type (zend_ast * ast ) {
9043
9046
zend_class_entry * ce = CG (active_class_entry );
@@ -9054,16 +9057,15 @@ static void zend_compile_associated_type(zend_ast *ast) {
9054
9057
bool persistent = ce -> type == ZEND_INTERNAL_CLASS ;
9055
9058
if (associated_types == NULL ) {
9056
9059
ce -> associated_types = pemalloc (sizeof (HashTable ), persistent );
9057
- zend_hash_init (ce -> associated_types , 8 , NULL , NULL , persistent );
9060
+ zend_hash_init (ce -> associated_types , 8 , NULL , zend_associated_table_ht_dtor , persistent );
9058
9061
associated_types = ce -> associated_types ;
9059
9062
}
9060
9063
if (zend_hash_exists (associated_types , name )) {
9061
9064
zend_error_noreturn (E_COMPILE_ERROR ,
9062
9065
"Cannot have two associated types with the same name \"%s\"" , ZSTR_VAL (name ));
9063
9066
}
9064
- zval tmp ;
9065
- ZVAL_UNDEF (& tmp );
9066
- zend_hash_add_new (associated_types , name , & tmp );
9067
+
9068
+ zend_hash_add_new_ptr (associated_types , name , (void * ) & zend_mixed_type );
9067
9069
}
9068
9070
9069
9071
static void zend_compile_implements (zend_ast * ast ) /* {{{ */
0 commit comments