Skip to content

Commit

Permalink
Respect static method visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Dec 27, 2018
1 parent e8daada commit 9bf80ef
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ext/opcache/Optimizer/zend_optimizer.c
Expand Up @@ -984,7 +984,14 @@ zend_function *zend_optimizer_get_called_func(
script, op_array, opline, rt_constants);
if (ce) {
zend_string *func_name = Z_STR_P(GET_OP(op2) + 1);
return zend_hash_find_ptr(&ce->function_table, func_name);
zend_function *fbc = zend_hash_find_ptr(&ce->function_table, func_name);
if (fbc) {
zend_bool is_public = (fbc->common.fn_flags & ZEND_ACC_PUBLIC) != 0;
zend_bool same_scope = fbc->common.scope == op_array->scope;
if (is_public|| same_scope) {
return fbc;
}
}
}
}
break;
Expand Down

0 comments on commit 9bf80ef

Please sign in to comment.