com php-src: Fix FETCH_CLASS_SELF comparisons: Zend/z end_compile.c ext/opcache/Optimizer/optimize_func_cal ls.c

From: Date: Sat, 26 Mar 2016 21:45:23 +0000
Subject: com php-src: Fix FETCH_CLASS_SELF comparisons: Zend/z end_compile.c ext/opcache/Optimizer/optimize_func_cal ls.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-91490@lists.php.net to get a copy of this message
Commit: b867bd1c8d00701c0952fca4ea5ef9af39f9bb07 Author: Nikita Popov <nikic@php.net> Sat, 26 Mar 2016 22:43:58 +0100 Parents: 556827dec93d9b9247999ddfa5da70e9593c5a74 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b867bd1c8d00701c0952fca4ea5ef9af39f9bb07 Log: Fix FETCH_CLASS_SELF comparisons Turns out those don't form a bitfield. Changed paths: M Zend/zend_compile.c M ext/opcache/Optimizer/optimize_func_calls.c Diff: diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 521cd08..64e0e0d 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3738,7 +3738,8 @@ void zend_compile_static_call(znode *result, zend_ast *ast, uint32_t type) /* {{ && zend_string_equals_ci(CG(active_class_entry)->name, lcname)) { ce = CG(active_class_entry); } - } else if (opline->op1_type == IS_UNUSED && (opline->op1.num & ZEND_FETCH_CLASS_SELF) + } else if (opline->op1_type == IS_UNUSED + && (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF && zend_is_scope_known()) { ce = CG(active_class_entry); } diff --git a/ext/opcache/Optimizer/optimize_func_calls.c b/ext/opcache/Optimizer/optimize_func_calls.c index 22829ad..5982df5 100644 --- a/ext/opcache/Optimizer/optimize_func_calls.c +++ b/ext/opcache/Optimizer/optimize_func_calls.c @@ -77,7 +77,7 @@ void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx) zend_string *class_name = Z_STR_P(&ZEND_OP1_LITERAL(opline) + 1); ce = zend_hash_find_ptr(&ctx->script->class_table, class_name); } else if (opline->op1_type == IS_UNUSED && op_array->scope - && (opline->op1.num & ZEND_FETCH_CLASS_SELF)) { + && (opline->op1.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF) { ce = op_array->scope; } if (ce) {

« previous php.cvs (#91490) next »