Skip to content

Commit 4558371

Browse files
committed
Set opline before calling undef op helper
1 parent a743fd7 commit 4558371

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12402,6 +12402,7 @@ static int zend_jit_isset_isempty_dim(dasm_State **Dst,
1240212402
if (op2_info & MAY_BE_ANY) {
1240312403
| IF_NOT_ZVAL_TYPE op2_addr, IS_UNDEF, >1
1240412404
}
12405+
| SET_EX_OPLINE opline, r0
1240512406
| mov FCARG1d, opline->op2.var
1240612407
| EXT_CALL zend_jit_undefined_op_helper, r0
1240712408
|1:

ext/opcache/tests/jit/isset_001.phpt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
ISSET_ISEMPTY_DIM with undefined variable
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.file_update_protection=0
7+
opcache.jit_buffer_size=1M
8+
--FILE--
9+
<?php
10+
function test() {
11+
var_dump(isset($a[$undef]));
12+
}
13+
test();
14+
?>
15+
--EXPECTF--
16+
Warning: Undefined variable $undef in %s on line %d
17+
bool(false)

0 commit comments

Comments
 (0)