@@ -4077,9 +4077,27 @@ static zend_always_inline zend_generator *zend_get_running_generator(EXECUTE_DAT
40774077}
40784078/* }}} */
40794079
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+
40804092static void cleanup_unfinished_calls (zend_execute_data * execute_data , uint32_t op_num ) /* {{{ */
40814093{
40824094 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+ }
40834101 zend_execute_data * call = EX (call );
40844102 zend_op * opline = EX (func )-> op_array .opcodes + op_num ;
40854103 int level ;
@@ -4222,18 +4240,6 @@ static const zend_live_range *find_live_range(const zend_op_array *op_array, uin
42224240}
42234241/* }}} */
42244242
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-
42374243static void cleanup_live_vars (zend_execute_data * execute_data , uint32_t op_num , uint32_t catch_op_num ) /* {{{ */
42384244{
42394245 int i ;
0 commit comments