From d02197853e5c2f01acd0986e2b496f502c4fe462 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 10 Mar 2021 17:39:26 +0300 Subject: [PATCH] Fixed assertion (ext/opcache/zend_persist.c:327: zend_accel_get_type_map_ptr: Assertion `ret > 2' failed) --- ext/opcache/zend_persist.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 19bc1ce7ad..1fb7281721 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -323,8 +323,9 @@ uint32_t zend_accel_get_type_map_ptr(zend_string *type_name, zend_class_entry *s /* We use type.name.gc.refcount to keep map_ptr of corresponding type */ if (ret <= 2) { - ret = (uint32_t)(uintptr_t)zend_map_ptr_new(); - ZEND_ASSERT(ret > 2); + do { + ret = (uint32_t)(uintptr_t)zend_map_ptr_new(); + } while (ret <= 2); GC_SET_REFCOUNT(type_name, ret); } return ret; -- 2.50.1