Skip to content

Commit 5b3e1de

Browse files
committed
Fixed bug #76205 (PHP-FPM sporadic crash when running Infinitewp)
1 parent 7ba70a5 commit 5b3e1de

File tree

2 files changed

+27
-22
lines changed

2 files changed

+27
-22
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ PHP NEWS
77
(mgorny)
88

99
- Opcache:
10+
. Fixed bug #76205 (PHP-FPM sporadic crash when running Infinitewp). (Dmitry)
1011
. Fixed bug #76275 (Assertion failure in file cache when unserializing empty
1112
try_catch_array). (Nikita)
1213
. Fixed bug #76281 (Opcache causes incorrect "undefined variable" errors).

ext/opcache/zend_file_cache.c

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -526,14 +526,13 @@ static void zend_file_cache_serialize_prop_info(zval *zv,
526526
prop = Z_PTR_P(zv);
527527
UNSERIALIZE_PTR(prop);
528528

529-
if (prop->ce && !IS_SERIALIZED(prop->ce)) {
529+
ZEND_ASSERT(prop->ce != NULL && prop->name != NULL);
530+
if (!IS_SERIALIZED(prop->ce)) {
530531
SERIALIZE_PTR(prop->ce);
531-
}
532-
if (prop->name && !IS_SERIALIZED(prop->name)) {
533532
SERIALIZE_STR(prop->name);
534-
}
535-
if (prop->doc_comment && !IS_SERIALIZED(prop->doc_comment)) {
536-
SERIALIZE_STR(prop->doc_comment);
533+
if (prop->doc_comment) {
534+
SERIALIZE_STR(prop->doc_comment);
535+
}
537536
}
538537
}
539538
}
@@ -550,12 +549,15 @@ static void zend_file_cache_serialize_class_constant(zval *z
550549
c = Z_PTR_P(zv);
551550
UNSERIALIZE_PTR(c);
552551

553-
zend_file_cache_serialize_zval(&c->value, script, info, buf);
554-
if (c->ce && !IS_SERIALIZED(c->ce)) {
552+
ZEND_ASSERT(c->ce != NULL);
553+
if (!IS_SERIALIZED(c->ce)) {
555554
SERIALIZE_PTR(c->ce);
556-
}
557-
if (c->doc_comment && !IS_SERIALIZED(c->doc_comment)) {
558-
SERIALIZE_STR(c->doc_comment);
555+
556+
zend_file_cache_serialize_zval(&c->value, script, info, buf);
557+
558+
if (c->doc_comment) {
559+
SERIALIZE_STR(c->doc_comment);
560+
}
559561
}
560562
}
561563
}
@@ -1144,14 +1146,13 @@ static void zend_file_cache_unserialize_prop_info(zval *zv,
11441146
UNSERIALIZE_PTR(Z_PTR_P(zv));
11451147
prop = Z_PTR_P(zv);
11461148

1147-
if (prop->ce && !IS_UNSERIALIZED(prop->ce)) {
1149+
ZEND_ASSERT(prop->ce != NULL && prop->name != NULL);
1150+
if (!IS_UNSERIALIZED(prop->ce)) {
11481151
UNSERIALIZE_PTR(prop->ce);
1149-
}
1150-
if (prop->name && !IS_UNSERIALIZED(prop->name)) {
11511152
UNSERIALIZE_STR(prop->name);
1152-
}
1153-
if (prop->doc_comment && !IS_UNSERIALIZED(prop->doc_comment)) {
1154-
UNSERIALIZE_STR(prop->doc_comment);
1153+
if (prop->doc_comment) {
1154+
UNSERIALIZE_STR(prop->doc_comment);
1155+
}
11551156
}
11561157
}
11571158
}
@@ -1166,12 +1167,15 @@ static void zend_file_cache_unserialize_class_constant(zval *
11661167
UNSERIALIZE_PTR(Z_PTR_P(zv));
11671168
c = Z_PTR_P(zv);
11681169

1169-
zend_file_cache_unserialize_zval(&c->value, script, buf);
1170-
if (c->ce && !IS_UNSERIALIZED(c->ce)) {
1170+
ZEND_ASSERT(c->ce != NULL);
1171+
if (!IS_UNSERIALIZED(c->ce)) {
11711172
UNSERIALIZE_PTR(c->ce);
1172-
}
1173-
if (c->doc_comment && !IS_UNSERIALIZED(c->doc_comment)) {
1174-
UNSERIALIZE_STR(c->doc_comment);
1173+
1174+
zend_file_cache_unserialize_zval(&c->value, script, buf);
1175+
1176+
if (c->doc_comment) {
1177+
UNSERIALIZE_STR(c->doc_comment);
1178+
}
11751179
}
11761180
}
11771181
}

0 commit comments

Comments
 (0)