summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-08-13 11:22:10 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-08-13 11:22:41 +0200
commita33361a37c0b3bfbeb821e33b254375459a9d2bc (patch)
tree1f5f724181d4d87d4968878aabe1084a4be30f5c
parent7ba54b9822161283c6290c6ad9b7305594023cc3 (diff)
parent4eeb41d1ea91fe7a44759f788ad5920eac8df0ef (diff)
downloadphp-git-a33361a37c0b3bfbeb821e33b254375459a9d2bc.tar.gz
Merge branch 'PHP-7.2' into PHP-7.3
-rw-r--r--NEWS4
-rw-r--r--ext/opcache/Optimizer/dce.c3
-rw-r--r--ext/opcache/tests/bug77191.phpt17
3 files changed, 23 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index c2a6bdac1a..9877bfe4b8 100644
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,10 @@ PHP NEWS
. Fixed bug #78179 (MariaDB server version incorrectly detected). (cmb)
. Fixed bug #78213 (Empty row pocket). (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)
diff --git a/ext/opcache/Optimizer/dce.c b/ext/opcache/Optimizer/dce.c
index 60da544bcc..ef65b6abdf 100644
--- a/ext/opcache/Optimizer/dce.c
+++ b/ext/opcache/Optimizer/dce.c
@@ -491,7 +491,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--;
}
diff --git a/ext/opcache/tests/bug77191.phpt b/ext/opcache/tests/bug77191.phpt
new file mode 100644
index 0000000000..ca04b4aadd
--- /dev/null
+++ b/ext/opcache/tests/bug77191.phpt
@@ -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"