Skip to content

Commit 4eeb41d

Browse files
committed
Fixed bug #77191
1 parent 18f2918 commit 4eeb41d

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ PHP NEWS
2424
- MySQLnd:
2525
. Fixed bug #78179 (MariaDB server version incorrectly detected). (cmb)
2626

27+
- Opcache:
28+
. Fixed bug #77191 (Assertion failure in dce_live_ranges() when silencing is
29+
used). (Nikita)
30+
2731
- Standard:
2832
. Fixed bug #69100 (Bus error from stream_copy_to_stream (file -> SSL stream)
2933
with invalid length). (Nikita)

ext/opcache/Optimizer/dce.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,8 @@ static void dce_live_ranges(context *ctx, zend_op_array *op_array, zend_ssa *ssa
565565

566566
if ((op_array->opcodes[def].result_type == IS_UNUSED) &&
567567
(UNEXPECTED(op_array->opcodes[def].opcode == ZEND_EXT_STMT) ||
568-
UNEXPECTED(op_array->opcodes[def].opcode == ZEND_EXT_FCALL_END))) {
568+
UNEXPECTED(op_array->opcodes[def].opcode == ZEND_EXT_FCALL_END) ||
569+
UNEXPECTED(op_array->opcodes[def].opcode == ZEND_END_SILENCE))) {
569570
def--;
570571
}
571572

ext/opcache/tests/bug77191.phpt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
Bug #77191: Assertion failure in dce_live_ranges() when silencing is used
3+
--FILE--
4+
<?php
5+
function test($x) {
6+
switch (@$x['y']) {
7+
case 1: return 'a';
8+
case 2: return 'b';
9+
case 3: return 'c';
10+
case 4: return 'd';
11+
}
12+
return 'e';
13+
}
14+
var_dump(test([]));
15+
?>
16+
--EXPECT--
17+
string(1) "e"

0 commit comments

Comments
 (0)