Skip to content

Commit

Permalink
Fixed bug #77191
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Aug 13, 2019
1 parent 18f2918 commit 4eeb41d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ PHP NEWS
- MySQLnd:
. Fixed bug #78179 (MariaDB server version incorrectly detected). (cmb)

- Opcache:
. Fixed bug #77191 (Assertion failure in dce_live_ranges() when silencing is
used). (Nikita)

- Standard:
. Fixed bug #69100 (Bus error from stream_copy_to_stream (file -> SSL stream)
with invalid length). (Nikita)
Expand Down
3 changes: 2 additions & 1 deletion ext/opcache/Optimizer/dce.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,8 @@ static void dce_live_ranges(context *ctx, zend_op_array *op_array, zend_ssa *ssa

if ((op_array->opcodes[def].result_type == IS_UNUSED) &&
(UNEXPECTED(op_array->opcodes[def].opcode == ZEND_EXT_STMT) ||
UNEXPECTED(op_array->opcodes[def].opcode == ZEND_EXT_FCALL_END))) {
UNEXPECTED(op_array->opcodes[def].opcode == ZEND_EXT_FCALL_END) ||
UNEXPECTED(op_array->opcodes[def].opcode == ZEND_END_SILENCE))) {
def--;
}

Expand Down
17 changes: 17 additions & 0 deletions ext/opcache/tests/bug77191.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--TEST--
Bug #77191: Assertion failure in dce_live_ranges() when silencing is used
--FILE--
<?php
function test($x) {
switch (@$x['y']) {
case 1: return 'a';
case 2: return 'b';
case 3: return 'c';
case 4: return 'd';
}
return 'e';
}
var_dump(test([]));
?>
--EXPECT--
string(1) "e"

0 comments on commit 4eeb41d

Please sign in to comment.