summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-08-26 16:12:47 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-08-26 16:12:47 +0200
commitade97c207c74609332e7d98450ef09b5caec0a70 (patch)
tree75825d7d6daf070d97c81be95f463e5dcce3f2d6
parent0ab4fca8e3f126649901f7a33e3dd8c320d7022e (diff)
parente2b49d6c45f0c5ed69268d32da2f4972265db663 (diff)
downloadphp-git-ade97c207c74609332e7d98450ef09b5caec0a70.tar.gz
Merge branch 'PHP-7.4'
-rw-r--r--Zend/tests/uncaught_exception_error_supression.phpt18
-rw-r--r--Zend/zend_opcode.c11
2 files changed, 24 insertions, 5 deletions
diff --git a/Zend/tests/uncaught_exception_error_supression.phpt b/Zend/tests/uncaught_exception_error_supression.phpt
new file mode 100644
index 0000000000..1130a9d99b
--- /dev/null
+++ b/Zend/tests/uncaught_exception_error_supression.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Error suppression should have no impact on uncaught exceptions
+--FILE--
+<?php
+
+function abc() {
+ throw new Error('Example Exception');
+}
+
+@abc();
+
+?>
+--EXPECTF--
+Fatal error: Uncaught Error: Example Exception in %s:%d
+Stack trace:
+#0 %s(%d): abc()
+#1 {main}
+ thrown in %s on line %d
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 1c4f812af3..54886a3d07 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -655,6 +655,12 @@ static void emit_live_range(
default:
start++;
kind = ZEND_LIVE_TMPVAR;
+
+ /* Check hook to determine whether a live range is necessary,
+ * e.g. based on type info. */
+ if (needs_live_range && !needs_live_range(op_array, orig_def_opline)) {
+ return;
+ }
break;
}
case ZEND_COPY_TMP:
@@ -694,11 +700,6 @@ static void emit_live_range(
}
}
- /* Check hook to determine whether a live range is necessary, e.g. based on type info. */
- if (needs_live_range && !needs_live_range(op_array, orig_def_opline)) {
- return;
- }
-
emit_live_range_raw(op_array, var_num, kind, start, end);
}