Skip to content

Commit e86a0a9

Browse files
committed
Assert that file cache does not contain references
1 parent 90a6003 commit e86a0a9

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

ext/opcache/zend_file_cache.c

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -375,16 +375,6 @@ static void zend_file_cache_serialize_zval(zval *zv,
375375
zend_file_cache_serialize_hash(ht, script, info, buf, zend_file_cache_serialize_zval);
376376
}
377377
break;
378-
case IS_REFERENCE:
379-
if (!IS_SERIALIZED(Z_REF_P(zv))) {
380-
zend_reference *ref;
381-
382-
SERIALIZE_PTR(Z_REF_P(zv));
383-
ref = Z_REF_P(zv);
384-
UNSERIALIZE_PTR(ref);
385-
zend_file_cache_serialize_zval(&ref->val, script, info, buf);
386-
}
387-
break;
388378
case IS_CONSTANT_AST:
389379
if (!IS_SERIALIZED(Z_AST_P(zv))) {
390380
zend_ast_ref *ast;
@@ -399,6 +389,9 @@ static void zend_file_cache_serialize_zval(zval *zv,
399389
/* Used by static properties. */
400390
SERIALIZE_PTR(Z_INDIRECT_P(zv));
401391
break;
392+
default:
393+
ZEND_ASSERT(Z_TYPE_P(zv) < IS_STRING);
394+
break;
402395
}
403396
}
404397

@@ -1171,15 +1164,6 @@ static void zend_file_cache_unserialize_zval(zval *zv,
11711164
script, buf, zend_file_cache_unserialize_zval, ZVAL_PTR_DTOR);
11721165
}
11731166
break;
1174-
case IS_REFERENCE:
1175-
if (!IS_UNSERIALIZED(Z_REF_P(zv))) {
1176-
zend_reference *ref;
1177-
1178-
UNSERIALIZE_PTR(Z_REF_P(zv));
1179-
ref = Z_REF_P(zv);
1180-
zend_file_cache_unserialize_zval(&ref->val, script, buf);
1181-
}
1182-
break;
11831167
case IS_CONSTANT_AST:
11841168
if (!IS_UNSERIALIZED(Z_AST_P(zv))) {
11851169
UNSERIALIZE_PTR(Z_AST_P(zv));
@@ -1190,6 +1174,9 @@ static void zend_file_cache_unserialize_zval(zval *zv,
11901174
/* Used by static properties. */
11911175
UNSERIALIZE_PTR(Z_INDIRECT_P(zv));
11921176
break;
1177+
default:
1178+
ZEND_ASSERT(Z_TYPE_P(zv) < IS_STRING);
1179+
break;
11931180
}
11941181
}
11951182

0 commit comments

Comments
 (0)