Skip to content

Commit f56a659

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Fix GH-15661: Access null pointer in Zend/Optimizer/zend_inference.c
2 parents 8bcfc8c + 75f5cbf commit f56a659

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

Zend/Optimizer/zend_inference.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5040,7 +5040,7 @@ ZEND_API bool zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op
50405040
return 0;
50415041
case ZEND_BIND_GLOBAL:
50425042
if ((opline+1)->opcode == ZEND_BIND_GLOBAL) {
5043-
return zend_may_throw(opline + 1, ssa_op + 1, op_array, ssa);
5043+
return zend_may_throw(opline + 1, ssa_op ? ssa_op + 1 : NULL, op_array, ssa);
50445044
}
50455045
return 0;
50465046
case ZEND_ADD:

ext/opcache/tests/jit/gh15666.phpt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
GH-15661 (Access null pointer in Zend/Optimizer/zend_inference.c)
3+
--EXTENSIONS--
4+
opcache
5+
--INI--
6+
opcache.jit=1201
7+
opcache.jit_buffer_size=64M
8+
--FILE--
9+
<?php
10+
11+
function test() {
12+
require 'dummy.inc';
13+
global $foo, $bar;
14+
$foo |= $bar;
15+
}
16+
17+
echo "Done\n";
18+
19+
?>
20+
--EXPECT--
21+
Done

0 commit comments

Comments
 (0)