Skip to content

Commit fabcd9f

Browse files
committed
Don't inline static call to instance method
Fixes the failure in bug79740.phpt with opcache.
1 parent 978cdb7 commit fabcd9f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/opcache/Optimizer/optimize_func_calls.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ static void zend_try_inline_call(zend_op_array *op_array, zend_op *fcall, zend_o
106106
uint32_t i, num_args = func->op_array.num_args;
107107
num_args += (func->op_array.fn_flags & ZEND_ACC_VARIADIC) != 0;
108108

109+
if (fcall->opcode == ZEND_INIT_STATIC_METHOD_CALL
110+
&& !(func->op_array.fn_flags & ZEND_ACC_STATIC)) {
111+
/* Don't inline static call to instance method. */
112+
return;
113+
}
114+
109115
if (fcall->opcode == ZEND_INIT_METHOD_CALL && fcall->op1_type == IS_UNUSED) {
110116
/* TODO: we can't inlne methods, because $this may be used
111117
* not in object context ???

0 commit comments

Comments
 (0)