@@ -3792,9 +3792,27 @@ static zend_always_inline zend_generator *zend_get_running_generator(EXECUTE_DAT
3792
3792
}
3793
3793
/* }}} */
3794
3794
3795
+ /* TODO Can this be done using find_live_range? */
3796
+ static bool is_in_silence_live_range (const zend_op_array op_array , uint32_t op_num ) {
3797
+ for (int i = 0 ; i < op_array .last_live_range ; i ++ ) {
3798
+ zend_live_range range = op_array .live_range [i ];
3799
+ if (op_num >= range .start && op_num < range .end
3800
+ && (range .var & ZEND_LIVE_MASK ) == ZEND_LIVE_SILENCE ) {
3801
+ return true;
3802
+ }
3803
+ }
3804
+ return false;
3805
+ }
3806
+
3795
3807
static void cleanup_unfinished_calls (zend_execute_data * execute_data , uint32_t op_num ) /* {{{ */
3796
3808
{
3797
3809
if (UNEXPECTED (EX (call ))) {
3810
+ /* Do not cleanup unfinished calls for SILENCE live range as it might still get executed
3811
+ * However, this can only happen if the exception is an instance of Exception
3812
+ * (Error never gets suppressed) */
3813
+ if (UNEXPECTED (is_in_silence_live_range (EX (func )-> op_array , op_num ))) {
3814
+ return ;
3815
+ }
3798
3816
zend_execute_data * call = EX (call );
3799
3817
zend_op * opline = EX (func )-> op_array .opcodes + op_num ;
3800
3818
int level ;
@@ -3937,18 +3955,6 @@ static const zend_live_range *find_live_range(const zend_op_array *op_array, uin
3937
3955
}
3938
3956
/* }}} */
3939
3957
3940
- /* TODO Can this be done using find_live_range? */
3941
- static bool is_in_silence_live_range (const zend_op_array op_array , uint32_t op_num ) {
3942
- for (int i = 0 ; i < op_array .last_live_range ; i ++ ) {
3943
- zend_live_range range = op_array .live_range [i ];
3944
- if (op_num >= range .start && op_num < range .end
3945
- && (range .var & ZEND_LIVE_MASK ) == ZEND_LIVE_SILENCE ) {
3946
- return true;
3947
- }
3948
- }
3949
- return false;
3950
- }
3951
-
3952
3958
static void cleanup_live_vars (zend_execute_data * execute_data , uint32_t op_num , uint32_t catch_op_num ) /* {{{ */
3953
3959
{
3954
3960
int i ;
0 commit comments