1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Don't use needs_live_range hook for "special" live ranges

In particular we were disgarding SILENCE live ranges in opcache,
because we decided that a MAY_BE_LONG type does not need a live
range.
This commit is contained in:
Nikita Popov
2019-08-26 16:10:29 +02:00
parent 8f897f1040
commit e2b49d6c45
2 changed files with 24 additions and 5 deletions

View File

@@ -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

View File

@@ -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);
}