diff options
author | Dmitry Stogov <dmitry@zend.com> | 2020-03-12 22:26:30 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2020-03-12 22:26:30 +0300 |
commit | c5159b383218968be307fb96f9fd19b2b6e17c90 (patch) | |
tree | 20bedb711481fd9af36b7395c93770e2318c4a92 /Zend | |
parent | b6492b44532f4083ace7bfb28fe8807d78ff6606 (diff) | |
download | php-git-c5159b383218968be307fb96f9fd19b2b6e17c90.tar.gz |
Check asserts early
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend_compile.c | 2 | ||||
-rw-r--r-- | Zend/zend_vm_def.h | 2 | ||||
-rw-r--r-- | Zend/zend_vm_execute.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 970011ac08..0f948e000b 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1075,6 +1075,7 @@ ZEND_API int do_bind_class(zval *lcname, zend_string *lc_parent_name) /* {{{ */ return FAILURE; } else { do { + ZEND_ASSERT(EG(current_execute_data)->func->op_array.fn_flags & ZEND_ACC_PRELOADED); if (zend_preload_autoload && zend_preload_autoload(EG(current_execute_data)->func->op_array.filename) == SUCCESS) { zv = zend_hash_find_ex(EG(class_table), Z_STR_P(rtd_key), 1); @@ -1082,7 +1083,6 @@ ZEND_API int do_bind_class(zval *lcname, zend_string *lc_parent_name) /* {{{ */ break; } } - ZEND_ASSERT(EG(current_execute_data)->func->op_array.fn_flags & ZEND_ACC_PRELOADED); zend_error_noreturn(E_ERROR, "Class %s wasn't preloaded", Z_STRVAL_P(lcname)); return FAILURE; } while (0); diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index bb6a300a60..900c21c3d3 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -7318,6 +7318,7 @@ ZEND_VM_HANDLER(146, ZEND_DECLARE_ANON_CLASS, ANY, ANY, CACHE_SLOT) if (UNEXPECTED(zv == NULL)) { SAVE_OPLINE(); do { + ZEND_ASSERT(EX(func)->op_array.fn_flags & ZEND_ACC_PRELOADED); if (zend_preload_autoload && zend_preload_autoload(EX(func)->op_array.filename) == SUCCESS) { zv = zend_hash_find_ex(EG(class_table), rtd_key, 1); @@ -7325,7 +7326,6 @@ ZEND_VM_HANDLER(146, ZEND_DECLARE_ANON_CLASS, ANY, ANY, CACHE_SLOT) break; } } - ZEND_ASSERT(EX(func)->op_array.fn_flags & ZEND_ACC_PRELOADED); zend_error_noreturn(E_ERROR, "Anonymous class wasn't preloaded"); } while (0); } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 722053bbdc..2fce1be298 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2450,6 +2450,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_ANON_CLASS_SPEC_HANDLE if (UNEXPECTED(zv == NULL)) { SAVE_OPLINE(); do { + ZEND_ASSERT(EX(func)->op_array.fn_flags & ZEND_ACC_PRELOADED); if (zend_preload_autoload && zend_preload_autoload(EX(func)->op_array.filename) == SUCCESS) { zv = zend_hash_find_ex(EG(class_table), rtd_key, 1); @@ -2457,7 +2458,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_ANON_CLASS_SPEC_HANDLE break; } } - ZEND_ASSERT(EX(func)->op_array.fn_flags & ZEND_ACC_PRELOADED); zend_error_noreturn(E_ERROR, "Anonymous class wasn't preloaded"); } while (0); } |