summaryrefslogtreecommitdiff
path: root/Zend/zend_vm_def.h
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_vm_def.h')
-rw-r--r--Zend/zend_vm_def.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 0282c3c584..bb6a300a60 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -7317,8 +7317,17 @@ ZEND_VM_HANDLER(146, ZEND_DECLARE_ANON_CLASS, ANY, ANY, CACHE_SLOT)
zv = zend_hash_find_ex(EG(class_table), rtd_key, 1);
if (UNEXPECTED(zv == NULL)) {
SAVE_OPLINE();
- ZEND_ASSERT(EX(func)->op_array.fn_flags & ZEND_ACC_PRELOADED);
- zend_error_noreturn(E_ERROR, "Anonymous class wasn't preloaded");
+ do {
+ if (zend_preload_autoload
+ && zend_preload_autoload(EX(func)->op_array.filename) == SUCCESS) {
+ zv = zend_hash_find_ex(EG(class_table), rtd_key, 1);
+ if (EXPECTED(zv != NULL)) {
+ break;
+ }
+ }
+ ZEND_ASSERT(EX(func)->op_array.fn_flags & ZEND_ACC_PRELOADED);
+ zend_error_noreturn(E_ERROR, "Anonymous class wasn't preloaded");
+ } while (0);
}
ZEND_ASSERT(zv != NULL);
ce = Z_CE_P(zv);