Use zend_hash_find() instead of zend_hash_find_ptr() to avoid double check

This commit is contained in:
Dmitry Stogov 2017-12-27 13:26:06 +03:00
parent 856ad54f45
commit a6fcbb7c87
3 changed files with 32 additions and 18 deletions

View file

@ -866,7 +866,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *key, int use_autoload) /* {{{ */
{
zend_class_entry *ce = NULL;
zval args[1];
zval args[1], *zv;
zval local_retval;
zend_string *lc_name;
zend_fcall_info fcall_info;
@ -887,12 +887,12 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
}
}
ce = zend_hash_find_ptr(EG(class_table), lc_name);
if (ce) {
zv = zend_hash_find(EG(class_table), lc_name);
if (zv) {
if (!key) {
zend_string_release(lc_name);
}
return ce;
return (zend_class_entry*)Z_PTR_P(zv);
}
/* The compiler is not-reentrant. Make sure we __autoload() only during run-time