1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix GH-16358: Segmentation fault (access null pointer) in Zend/zend_operators.c:2495

This commit is contained in:
Dmitry Stogov
2024-10-15 15:37:30 +03:00
parent 23c60d6b72
commit b9a64c5e34
2 changed files with 22 additions and 0 deletions

View File

@@ -9108,6 +9108,7 @@ static int zend_jit_init_static_method_call(zend_jit_ctx *jit,
if (fn->common.scope == op_array->scope
|| (fn->common.fn_flags & ZEND_ACC_PUBLIC)
|| ((fn->common.fn_flags & ZEND_ACC_PROTECTED)
&& op_array->scope
&& instanceof_function_slow(op_array->scope, fn->common.scope))) {
func = fn;
}
@@ -15823,6 +15824,7 @@ static int zend_jit_fetch_static_prop(zend_jit_ctx *jit, const zend_op *opline,
if (prop_info->ce == op_array->scope
|| (prop_info->flags & ZEND_ACC_PUBLIC)
|| ((prop_info->flags & ZEND_ACC_PROTECTED)
&& op_array->scope
&& instanceof_function_slow(op_array->scope, prop_info->ce))) {
known_prop_info = prop_info;
}

View File

@@ -0,0 +1,20 @@
--TEST--
GH-16358 (Segmentation fault (access null pointer) in Zend/zend_operators.c:2495)
--EXTENSIONS--
opcache
--INI--
opcache.jit=1214
opcache.jit_buffer_size=64M
--FILE--
<?php
class test_class {
static protected function test_func4() {
}
}
if (is_callable(array('test_class','test_func4'))) {
test_class::test_func4();
}
?>
OK
--EXPECT--
OK