Skip to content

Commit

Permalink
JIT: Fixed FETCH_LIST_R on string
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Oct 7, 2021
1 parent b47a48f commit 7cea20f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -12024,7 +12024,7 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
}

if ((op1_info & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_ARRAY|MAY_BE_OBJECT|may_be_string)))
&& (!exit_addr || !(op1_info & (MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_STRING)))) {
&& (!exit_addr || !(op1_info & (MAY_BE_ARRAY|MAY_BE_OBJECT|may_be_string)))) {
if (opline->opcode != ZEND_FETCH_DIM_IS && opline->opcode != ZEND_FETCH_LIST_R) {
if ((op1_info & MAY_BE_UNDEF) || (op2_info & MAY_BE_UNDEF)) {
| LOAD_ZVAL_ADDR FCARG1a, orig_op1_addr
Expand Down
18 changes: 18 additions & 0 deletions ext/opcache/tests/jit/fetch_list_r_001.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
JIT FETCH_LIST_R: 001
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
--FILE--
<?php
function test() {
$v = 'a';
list($$v) = "";
var_dump($a);
}
test();
?>
--EXPECT--
NULL

0 comments on commit 7cea20f

Please sign in to comment.