@@ -2593,6 +2593,11 @@ static zend_ffi_type* accel_ffi_persist_type_copy(void** ptr, zend_ffi_type *typ
2593
2593
break ;
2594
2594
case ZEND_FFI_TYPE_STRUCT :
2595
2595
ht = & new_type -> record .fields ;
2596
+ GC_SET_REFCOUNT (ht , 2 );
2597
+ GC_ADD_FLAGS (ht , IS_ARRAY_IMMUTABLE );
2598
+ HT_FLAGS (ht ) |= HASH_FLAG_STATIC_KEYS ;
2599
+ ht -> pDestructor = NULL ;
2600
+ ht -> nInternalPointer = 0 ;
2596
2601
if (HT_IS_PACKED (ht )) {
2597
2602
memcpy (* ptr , ht -> arPacked , HT_PACKED_USED_SIZE (ht ));
2598
2603
ht -> arPacked = (zval * )(* ptr );
@@ -2619,6 +2624,11 @@ static zend_ffi_type* accel_ffi_persist_type_copy(void** ptr, zend_ffi_type *typ
2619
2624
memcpy (ht , new_type -> func .args , sizeof (HashTable ));
2620
2625
(* ptr ) = (void * )((char * )(* ptr ) + sizeof (HashTable ));
2621
2626
new_type -> func .args = ht ;
2627
+ GC_SET_REFCOUNT (ht , 2 );
2628
+ GC_ADD_FLAGS (ht , IS_ARRAY_IMMUTABLE );
2629
+ HT_FLAGS (ht ) |= HASH_FLAG_STATIC_KEYS ;
2630
+ ht -> pDestructor = NULL ;
2631
+ ht -> nInternalPointer = 0 ;
2622
2632
ZEND_ASSERT (HT_IS_PACKED (ht ));
2623
2633
memcpy (* ptr , ht -> arPacked , HT_PACKED_USED_SIZE (ht ));
2624
2634
ht -> arPacked = (zval * )(* ptr );
0 commit comments