From fabcd9f14e52567fa41df189298c388336277b54 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 29 Jun 2020 09:52:37 +0200 Subject: Don't inline static call to instance method Fixes the failure in bug79740.phpt with opcache. --- ext/opcache/Optimizer/optimize_func_calls.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/opcache/Optimizer/optimize_func_calls.c b/ext/opcache/Optimizer/optimize_func_calls.c index ae707a2409..6af7865e92 100644 --- a/ext/opcache/Optimizer/optimize_func_calls.c +++ b/ext/opcache/Optimizer/optimize_func_calls.c @@ -106,6 +106,12 @@ static void zend_try_inline_call(zend_op_array *op_array, zend_op *fcall, zend_o uint32_t i, num_args = func->op_array.num_args; num_args += (func->op_array.fn_flags & ZEND_ACC_VARIADIC) != 0; + if (fcall->opcode == ZEND_INIT_STATIC_METHOD_CALL + && !(func->op_array.fn_flags & ZEND_ACC_STATIC)) { + /* Don't inline static call to instance method. */ + return; + } + if (fcall->opcode == ZEND_INIT_METHOD_CALL && fcall->op1_type == IS_UNUSED) { /* TODO: we can't inlne methods, because $this may be used * not in object context ??? -- cgit v1.2.1