Skip to content

Fix GH-18037: SEGV Zend/zend_execute.c #18048

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 1 commit 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
1 change: 1 addition & 0 deletions ext/opcache/jit/zend_jit_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -4209,6 +4209,7 @@ static int zend_jit_handler(zend_jit_ctx *jit, const zend_op *opline, int may_th
case ZEND_ASSIGN_STATIC_PROP_OP:
case ZEND_ASSIGN_STATIC_PROP_REF:
case ZEND_ASSIGN_OBJ_REF:
case ZEND_FRAMELESS_ICALL_3:
zend_jit_set_last_valid_opline(jit, opline + 2);
break;
default:
Expand Down
24 changes: 24 additions & 0 deletions ext/opcache/tests/jit/gh18037.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--TEST--
GH-18037 (SEGV Zend/zend_execute.c)
--EXTENSIONS--
opcache
--INI--
opcache.jit=1201
--FILE--
<?php
function test_helper()
{
$list = [];
\in_array($list[0], $list, true) !== $list->matches();
}

test_helper();
?>
--EXPECTF--
Warning: Undefined array key 0 in %s on line %d

Fatal error: Uncaught Error: Call to a member function matches() on array in %s:%d
Stack trace:
#0 %s(%d): test_helper()
#1 {main}
thrown in %s on line %d
Loading