@@ -9028,7 +9028,10 @@ static void zend_compile_use_trait(zend_ast *ast) /* {{{ */
9028
9028
}
9029
9029
/* }}} */
9030
9030
9031
-
9031
+ static void zend_associated_table_ht_dtor (zval * val ) {
9032
+ /* NO OP as we only use it to be able to refer and save pointers to zend_types */
9033
+ // TODO do we actually want to store copies of types?
9034
+ }
9032
9035
9033
9036
static void zend_compile_associated_type (zend_ast * ast ) {
9034
9037
zend_class_entry * ce = CG (active_class_entry );
@@ -9045,16 +9048,15 @@ static void zend_compile_associated_type(zend_ast *ast) {
9045
9048
bool persistent = ce -> type == ZEND_INTERNAL_CLASS ;
9046
9049
if (associated_types == NULL ) {
9047
9050
ce -> associated_types = pemalloc (sizeof (HashTable ), persistent );
9048
- zend_hash_init (ce -> associated_types , 8 , NULL , NULL , persistent );
9051
+ zend_hash_init (ce -> associated_types , 8 , NULL , zend_associated_table_ht_dtor , persistent );
9049
9052
associated_types = ce -> associated_types ;
9050
9053
}
9051
9054
if (zend_hash_exists (associated_types , name )) {
9052
9055
zend_error_noreturn (E_COMPILE_ERROR ,
9053
9056
"Cannot have two associated types with the same name \"%s\"" , ZSTR_VAL (name ));
9054
9057
}
9055
- zval tmp ;
9056
- ZVAL_UNDEF (& tmp );
9057
- zend_hash_add_new (associated_types , name , & tmp );
9058
+
9059
+ zend_hash_add_new_ptr (associated_types , name , (void * ) & zend_mixed_type );
9058
9060
}
9059
9061
9060
9062
static void zend_compile_implements (zend_ast * ast ) /* {{{ */
0 commit comments