Skip to content

Commit

Permalink
Set opline before calling undef op helper
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Oct 7, 2021
1 parent a743fd7 commit 4558371
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -12402,6 +12402,7 @@ static int zend_jit_isset_isempty_dim(dasm_State **Dst,
if (op2_info & MAY_BE_ANY) {
| IF_NOT_ZVAL_TYPE op2_addr, IS_UNDEF, >1
}
| SET_EX_OPLINE opline, r0
| mov FCARG1d, opline->op2.var
| EXT_CALL zend_jit_undefined_op_helper, r0
|1:
Expand Down
17 changes: 17 additions & 0 deletions ext/opcache/tests/jit/isset_001.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--TEST--
ISSET_ISEMPTY_DIM with undefined variable
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
--FILE--
<?php
function test() {
var_dump(isset($a[$undef]));
}
test();
?>
--EXPECTF--
Warning: Undefined variable $undef in %s on line %d
bool(false)

0 comments on commit 4558371

Please sign in to comment.