Skip to content

Commit 75f5cbf

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix GH-15661: Access null pointer in Zend/Optimizer/zend_inference.c
2 parents 1fdd79c + 86ef8d5 commit 75f5cbf

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ PHP NEWS
3232
. Fixed bug GH-15432 (Heap corruption when querying a vector). (cmb,
3333
Kamil Tekiela)
3434

35+
- Opcache:
36+
. Fixed bug GH-15661 (Access null pointer in
37+
Zend/Optimizer/zend_inference.c). (nielsdos)
38+
3539
- Standard:
3640
. Fixed bug GH-15552 (Signed integer overflow in ext/standard/scanf.c). (cmb)
3741

Zend/Optimizer/zend_inference.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4914,7 +4914,7 @@ ZEND_API bool zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op
49144914
return 0;
49154915
case ZEND_BIND_GLOBAL:
49164916
if ((opline+1)->opcode == ZEND_BIND_GLOBAL) {
4917-
return zend_may_throw(opline + 1, ssa_op + 1, op_array, ssa);
4917+
return zend_may_throw(opline + 1, ssa_op ? ssa_op + 1 : NULL, op_array, ssa);
49184918
}
49194919
return 0;
49204920
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)