Skip to content

Commit fd58f61

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix assertion
2 parents 0c8e45e + 5350952 commit fd58f61

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Zend/zend_opcode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,12 +878,12 @@ static bool keeps_op1_alive(zend_op *opline) {
878878
|| opline->opcode == ZEND_SWITCH_STRING
879879
|| opline->opcode == ZEND_MATCH
880880
|| opline->opcode == ZEND_FETCH_LIST_R
881+
|| opline->opcode == ZEND_FETCH_LIST_W
881882
|| opline->opcode == ZEND_COPY_TMP) {
882883
return 1;
883884
}
884885
ZEND_ASSERT(opline->opcode != ZEND_FE_FETCH_R
885886
&& opline->opcode != ZEND_FE_FETCH_RW
886-
&& opline->opcode != ZEND_FETCH_LIST_W
887887
&& opline->opcode != ZEND_VERIFY_RETURN_TYPE
888888
&& opline->opcode != ZEND_BIND_LEXICAL
889889
&& opline->opcode != ZEND_ROPE_ADD);

ext/opcache/tests/opt/dce_014.phpt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
DCE may remove FREE after FETCH_LIST_W
3+
--FILE--
4+
<?php
5+
function () {
6+
$a = $r[][] = $r = [] & $y;
7+
+list(&$y) = $a;
8+
}
9+
?>
10+
DONE
11+
--EXPECT--
12+
DONE

0 commit comments

Comments
 (0)