1
0
mirror of https://github.com/php/php-src.git synced 2026-04-03 22:22:18 +02:00

Fix FETCH_CLASS_SELF comparisons

Turns out those don't form a bitfield.
This commit is contained in:
Nikita Popov
2016-03-26 22:43:58 +01:00
parent 556827dec9
commit b867bd1c8d
2 changed files with 3 additions and 2 deletions

View File

@@ -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);
}

View File

@@ -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) {