Merge branch 'PHP-8.2' into PHP-8.3

* PHP-8.2:
  Fix GH-15661: Access null pointer in Zend/Optimizer/zend_inference.c
This commit is contained in:
Niels Dossche 2024-09-09 20:12:01 +02:00
commit 75f5cbf89e
No known key found for this signature in database
GPG key ID: B8A8AD166DF0E2E5
3 changed files with 26 additions and 1 deletions

4
NEWS
View file

@ -32,6 +32,10 @@ PHP NEWS
. Fixed bug GH-15432 (Heap corruption when querying a vector). (cmb, . Fixed bug GH-15432 (Heap corruption when querying a vector). (cmb,
Kamil Tekiela) Kamil Tekiela)
- Opcache:
. Fixed bug GH-15661 (Access null pointer in
Zend/Optimizer/zend_inference.c). (nielsdos)
- Standard: - Standard:
. Fixed bug GH-15552 (Signed integer overflow in ext/standard/scanf.c). (cmb) . Fixed bug GH-15552 (Signed integer overflow in ext/standard/scanf.c). (cmb)

View file

@ -4914,7 +4914,7 @@ ZEND_API bool zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op
return 0; return 0;
case ZEND_BIND_GLOBAL: case ZEND_BIND_GLOBAL:
if ((opline+1)->opcode == ZEND_BIND_GLOBAL) { if ((opline+1)->opcode == ZEND_BIND_GLOBAL) {
return zend_may_throw(opline + 1, ssa_op + 1, op_array, ssa); return zend_may_throw(opline + 1, ssa_op ? ssa_op + 1 : NULL, op_array, ssa);
} }
return 0; return 0;
case ZEND_ADD: case ZEND_ADD:

View file

@ -0,0 +1,21 @@
--TEST--
GH-15661 (Access null pointer in Zend/Optimizer/zend_inference.c)
--EXTENSIONS--
opcache
--INI--
opcache.jit=1201
opcache.jit_buffer_size=64M
--FILE--
<?php
function test() {
require 'dummy.inc';
global $foo, $bar;
$foo |= $bar;
}
echo "Done\n";
?>
--EXPECT--
Done