Skip to content

Commit 5350952

Browse files
committed
Fix assertion
Fixes oss-fuzz #65233
1 parent d98a45d commit 5350952

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
@@ -867,12 +867,12 @@ static bool keeps_op1_alive(zend_op *opline) {
867867
|| opline->opcode == ZEND_SWITCH_STRING
868868
|| opline->opcode == ZEND_MATCH
869869
|| opline->opcode == ZEND_FETCH_LIST_R
870+
|| opline->opcode == ZEND_FETCH_LIST_W
870871
|| opline->opcode == ZEND_COPY_TMP) {
871872
return 1;
872873
}
873874
ZEND_ASSERT(opline->opcode != ZEND_FE_FETCH_R
874875
&& opline->opcode != ZEND_FE_FETCH_RW
875-
&& opline->opcode != ZEND_FETCH_LIST_W
876876
&& opline->opcode != ZEND_VERIFY_RETURN_TYPE
877877
&& opline->opcode != ZEND_BIND_LEXICAL
878878
&& 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)