@@ -4077,9 +4077,27 @@ static zend_always_inline zend_generator *zend_get_running_generator(EXECUTE_DAT
4077
4077
}
4078
4078
/* }}} */
4079
4079
4080
+ /* TODO Can this be done using find_live_range? */
4081
+ static bool is_in_silence_live_range (const zend_op_array op_array , uint32_t op_num ) {
4082
+ for (int i = 0 ; i < op_array .last_live_range ; i ++ ) {
4083
+ zend_live_range range = op_array .live_range [i ];
4084
+ if (op_num >= range .start && op_num < range .end
4085
+ && (range .var & ZEND_LIVE_MASK ) == ZEND_LIVE_SILENCE ) {
4086
+ return true;
4087
+ }
4088
+ }
4089
+ return false;
4090
+ }
4091
+
4080
4092
static void cleanup_unfinished_calls (zend_execute_data * execute_data , uint32_t op_num ) /* {{{ */
4081
4093
{
4082
4094
if (UNEXPECTED (EX (call ))) {
4095
+ /* Do not cleanup unfinished calls for SILENCE live range as it might still get executed
4096
+ * However, this can only happen if the exception is an instance of Exception
4097
+ * (Error never gets suppressed) */
4098
+ if (UNEXPECTED (is_in_silence_live_range (EX (func )-> op_array , op_num ))) {
4099
+ return ;
4100
+ }
4083
4101
zend_execute_data * call = EX (call );
4084
4102
zend_op * opline = EX (func )-> op_array .opcodes + op_num ;
4085
4103
int level ;
@@ -4222,18 +4240,6 @@ static const zend_live_range *find_live_range(const zend_op_array *op_array, uin
4222
4240
}
4223
4241
/* }}} */
4224
4242
4225
- /* TODO Can this be done using find_live_range? */
4226
- static bool is_in_silence_live_range (const zend_op_array op_array , uint32_t op_num ) {
4227
- for (int i = 0 ; i < op_array .last_live_range ; i ++ ) {
4228
- zend_live_range range = op_array .live_range [i ];
4229
- if (op_num >= range .start && op_num < range .end
4230
- && (range .var & ZEND_LIVE_MASK ) == ZEND_LIVE_SILENCE ) {
4231
- return true;
4232
- }
4233
- }
4234
- return false;
4235
- }
4236
-
4237
4243
static void cleanup_live_vars (zend_execute_data * execute_data , uint32_t op_num , uint32_t catch_op_num ) /* {{{ */
4238
4244
{
4239
4245
int i ;
0 commit comments