target_hash = HASH_OF(var);
if (target_hash != NULL) {
while ((hash_entry = zend_hash_get_current_data(target_hash)) != NULL) {
- if (++target_hash->u.v.nApplyCount > 1) {
- --target_hash->u.v.nApplyCount;
- recursion_error = 1;
- goto detect_end;
+ if (!Z_IMMUTABLE_P(var)) {
+ if (++target_hash->u.v.nApplyCount > 1) {
+ --target_hash->u.v.nApplyCount;
+ recursion_error = 1;
+ goto detect_end;
+ }
}
zend_hash_move_forward(target_hash);
if (Z_TYPE_P(hash_entry) == IS_INDIRECT) {
}
if (recursion_error) {
while(stack_level-- && (var = &stack[stack_level])) {
- if (HASH_OF(var)->u.v.nApplyCount > 1) {
- HASH_OF(var)->u.v.nApplyCount--;
+ if (!Z_IMMUTABLE_P(var)) {
+ if (HASH_OF(var)->u.v.nApplyCount > 1) {
+ HASH_OF(var)->u.v.nApplyCount--;
+ }
}
}
efree(stack);
hash_entry = hash_entry_ptr;
ZVAL_DEREF(hash_entry);
if (Z_TYPE_P(hash_entry) == IS_ARRAY || Z_TYPE_P(hash_entry) == IS_OBJECT) {
- if (++(HASH_OF(hash_entry)->u.v.nApplyCount) > 1) {
- --(HASH_OF(hash_entry)->u.v.nApplyCount);
- recursion_error = 1;
- goto conv_end;
+ if (!Z_IMMUTABLE_P(hash_entry)) {
+ if (++(HASH_OF(hash_entry)->u.v.nApplyCount) > 1) {
+ --(HASH_OF(hash_entry)->u.v.nApplyCount);
+ recursion_error = 1;
+ goto conv_end;
+ }
}
if (stack_level >= stack_max) {
stack_max += PHP_MBSTR_STACK_BLOCK_SIZE;
if (recursion_error) {
while(stack_level-- && (var = &stack[stack_level])) {
- if (HASH_OF(var)->u.v.nApplyCount > 1) {
- HASH_OF(var)->u.v.nApplyCount--;
+ if (!Z_IMMUTABLE_P(var)) {
+ if (HASH_OF(var)->u.v.nApplyCount > 1) {
+ HASH_OF(var)->u.v.nApplyCount--;
+ }
}
}
efree(stack);