com php-src: op_arrays may be optimized independetly and "script" might be NULL: ext/opcache/Opti mizer/zend_inference.c
ext/opcache/Optimizer/zend_ssa .c

From: Date: Tue, 23 Aug 2016 10:17:53 +0000
Subject: com php-src: op_arrays may be optimized independetly and "script" might be NULL: ext/opcache/Opti mizer/zend_inference.c
ext/opcache/Optimizer/zend_ssa .c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-94052@lists.php.net to get a copy of this message
Commit: 129e8dadf447df7d98a08447bc8c950b7c9209ec Author: Dmitry Stogov <dmitry@zend.com> Tue, 23 Aug 2016 13:17:53 +0300 Parents: 76707dc20418b3922d81de1166679587fcb66eb2 Branches: PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=129e8dadf447df7d98a08447bc8c950b7c9209ec Log: op_arrays may be optimized independetly and "script" might be NULL Changed paths: M ext/opcache/Optimizer/zend_inference.c M ext/opcache/Optimizer/zend_ssa.c Diff: diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index 174528f..1e65a25 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -2350,7 +2350,7 @@ static inline zend_uchar get_compound_assign_op(zend_uchar opcode) { } static inline zend_class_entry *get_class_entry(const zend_script *script, zend_string *lcname) { - zend_class_entry *ce = zend_hash_find_ptr(&script->class_table, lcname); + zend_class_entry *ce = script ? zend_hash_find_ptr(&script->class_table, lcname) : NULL; if (ce) { return ce; } @@ -2943,7 +2943,7 @@ static void zend_update_type_info(const zend_op_array *op_array, case ZEND_DECLARE_ANON_CLASS: case ZEND_DECLARE_ANON_INHERITED_CLASS: UPDATE_SSA_TYPE(MAY_BE_CLASS, ssa_ops[i].result_def); - if ((ce = zend_hash_find_ptr(&script->class_table, Z_STR_P(CRT_CONSTANT_EX(op_array, opline->op1, ssa->rt_constants)))) != NULL) { + if (script && (ce = zend_hash_find_ptr(&script->class_table, Z_STR_P(CRT_CONSTANT_EX(op_array, opline->op1, ssa->rt_constants)))) != NULL) { UPDATE_SSA_OBJ_TYPE(ce, 0, ssa_ops[i].result_def); } break; diff --git a/ext/opcache/Optimizer/zend_ssa.c b/ext/opcache/Optimizer/zend_ssa.c index 3d09c7e..b61a8da 100644 --- a/ext/opcache/Optimizer/zend_ssa.c +++ b/ext/opcache/Optimizer/zend_ssa.c @@ -501,7 +501,7 @@ static void place_essa_pis( (opline-1)->op2_type == IS_CONST) { int var = EX_VAR_TO_NUM((opline-1)->op1.var); zend_string *lcname = Z_STR_P(CRT_CONSTANT((opline-1)->op2) + 1); - zend_class_entry *ce = zend_hash_find_ptr(&script->class_table, lcname); + zend_class_entry *ce = script ? zend_hash_find_ptr(&script->class_table, lcname) : NULL; if (!ce) { ce = zend_hash_find_ptr(CG(class_table), lcname); if (!ce || ce->type != ZEND_INTERNAL_CLASS) {

« previous php.cvs (#94052) next »