Skip to content

Fix GH-15661: Access null pointer in Zend/Optimizer/zend_inference.c #15666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Zend/Optimizer/zend_inference.c
Original file line number Diff line number Diff line change
Expand Up @@ -5040,7 +5040,7 @@ ZEND_API bool zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op
return 0;
case 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;
case ZEND_ADD:
Expand Down
21 changes: 21 additions & 0 deletions ext/opcache/tests/jit/gh15666.phpt
Original file line number Diff line number Diff line change
@@ -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
Loading