@@ -259,40 +259,35 @@ static void zend_persist_zval(zval *z)
259
259
260
260
static HashTable * zend_persist_attributes (HashTable * attributes )
261
261
{
262
- HashTable * ptr = zend_shared_alloc_get_xlat_entry (attributes );
263
-
264
- if (!ptr ) {
265
- uint32_t i ;
266
- zval * v ;
262
+ uint32_t i ;
263
+ zval * v ;
267
264
268
- if (!ZCG (current_persistent_script )-> corrupted
269
- && zend_accel_in_shm (attributes )) {
270
- return attributes ;
271
- }
265
+ if (!ZCG (current_persistent_script )-> corrupted && zend_accel_in_shm (attributes )) {
266
+ return attributes ;
267
+ }
272
268
273
- zend_hash_persist (attributes );
269
+ zend_hash_persist (attributes );
274
270
275
- ZEND_HASH_FOREACH_VAL (attributes , v ) {
276
- zend_attribute * attr = Z_PTR_P (v );
277
- zend_attribute * copy = zend_shared_memdup_put_free (attr , ZEND_ATTRIBUTE_SIZE (attr -> argc ));
271
+ ZEND_HASH_FOREACH_VAL (attributes , v ) {
272
+ zend_attribute * attr = Z_PTR_P (v );
273
+ zend_attribute * copy = zend_shared_memdup_put_free (attr , ZEND_ATTRIBUTE_SIZE (attr -> argc ));
278
274
279
- zend_accel_store_interned_string (copy -> name );
280
- zend_accel_store_interned_string (copy -> lcname );
275
+ zend_accel_store_interned_string (copy -> name );
276
+ zend_accel_store_interned_string (copy -> lcname );
281
277
282
- for (i = 0 ; i < copy -> argc ; i ++ ) {
283
- if (copy -> args [i ].name ) {
284
- zend_accel_store_interned_string (copy -> args [i ].name );
285
- }
286
- zend_persist_zval (& copy -> args [i ].value );
278
+ for (i = 0 ; i < copy -> argc ; i ++ ) {
279
+ if (copy -> args [i ].name ) {
280
+ zend_accel_store_interned_string (copy -> args [i ].name );
287
281
}
282
+ zend_persist_zval (& copy -> args [i ].value );
283
+ }
288
284
289
- ZVAL_PTR (v , copy );
290
- } ZEND_HASH_FOREACH_END ();
285
+ ZVAL_PTR (v , copy );
286
+ } ZEND_HASH_FOREACH_END ();
291
287
292
- ptr = zend_shared_memdup_put_free (attributes , sizeof (HashTable ));
293
- GC_SET_REFCOUNT (ptr , 2 );
294
- GC_TYPE_INFO (ptr ) = GC_ARRAY | ((IS_ARRAY_IMMUTABLE |GC_NOT_COLLECTABLE ) << GC_FLAGS_SHIFT );
295
- }
288
+ HashTable * ptr = zend_shared_memdup_put_free (attributes , sizeof (HashTable ));
289
+ GC_SET_REFCOUNT (ptr , 2 );
290
+ GC_TYPE_INFO (ptr ) = GC_ARRAY | ((IS_ARRAY_IMMUTABLE |GC_NOT_COLLECTABLE ) << GC_FLAGS_SHIFT );
296
291
297
292
return ptr ;
298
293
}
@@ -450,7 +445,8 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
450
445
}
451
446
}
452
447
if (op_array -> attributes ) {
453
- op_array -> attributes = zend_persist_attributes (op_array -> attributes );
448
+ op_array -> attributes = zend_shared_alloc_get_xlat_entry (op_array -> attributes );
449
+ ZEND_ASSERT (op_array -> attributes != NULL );
454
450
}
455
451
456
452
if (op_array -> try_catch_array ) {
0 commit comments