@@ -3883,9 +3883,27 @@ static zend_always_inline zend_generator *zend_get_running_generator(EXECUTE_DAT
3883
3883
}
3884
3884
/* }}} */
3885
3885
3886
+ /* TODO Can this be done using find_live_range? */
3887
+ static bool is_in_silence_live_range (const zend_op_array op_array , uint32_t op_num ) {
3888
+ for (int i = 0 ; i < op_array .last_live_range ; i ++ ) {
3889
+ zend_live_range range = op_array .live_range [i ];
3890
+ if (op_num >= range .start && op_num < range .end
3891
+ && (range .var & ZEND_LIVE_MASK ) == ZEND_LIVE_SILENCE ) {
3892
+ return true;
3893
+ }
3894
+ }
3895
+ return false;
3896
+ }
3897
+
3886
3898
static void cleanup_unfinished_calls (zend_execute_data * execute_data , uint32_t op_num ) /* {{{ */
3887
3899
{
3888
3900
if (UNEXPECTED (EX (call ))) {
3901
+ /* Do not cleanup unfinished calls for SILENCE live range as it might still get executed
3902
+ * However, this can only happen if the exception is an instance of Exception
3903
+ * (Error never gets suppressed) */
3904
+ if (UNEXPECTED (is_in_silence_live_range (EX (func )-> op_array , op_num ))) {
3905
+ return ;
3906
+ }
3889
3907
zend_execute_data * call = EX (call );
3890
3908
zend_op * opline = EX (func )-> op_array .opcodes + op_num ;
3891
3909
int level ;
@@ -4028,18 +4046,6 @@ static const zend_live_range *find_live_range(const zend_op_array *op_array, uin
4028
4046
}
4029
4047
/* }}} */
4030
4048
4031
- /* TODO Can this be done using find_live_range? */
4032
- static bool is_in_silence_live_range (const zend_op_array op_array , uint32_t op_num ) {
4033
- for (int i = 0 ; i < op_array .last_live_range ; i ++ ) {
4034
- zend_live_range range = op_array .live_range [i ];
4035
- if (op_num >= range .start && op_num < range .end
4036
- && (range .var & ZEND_LIVE_MASK ) == ZEND_LIVE_SILENCE ) {
4037
- return true;
4038
- }
4039
- }
4040
- return false;
4041
- }
4042
-
4043
4049
static void cleanup_live_vars (zend_execute_data * execute_data , uint32_t op_num , uint32_t catch_op_num ) /* {{{ */
4044
4050
{
4045
4051
int i ;
0 commit comments