Skip to content

Commit fd729cb

Browse files
committed
Simplify
1 parent 72766ed commit fd729cb

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

Zend/zend.c

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,28 +1453,26 @@ ZEND_API ZEND_COLD void zend_error_zstr_at(
14531453
}
14541454

14551455
/* Emit any delayed error before handling fatal error */
1456-
if ((type & E_FATAL_ERRORS) && !(type & E_DONT_BAIL)) {
1457-
if (EG(num_errors)) {
1458-
uint32_t num_errors = EG(num_errors);
1459-
zend_error_info **errors = EG(errors);
1460-
EG(num_errors) = 0;
1461-
EG(errors) = NULL;
1462-
1463-
bool orig_record_errors = EG(record_errors);
1464-
EG(record_errors) = false;
1465-
1466-
/* Disable user error handler before emitting delayed errors, as
1467-
* it's unsafe to execute user code after a fatal error. */
1468-
int orig_user_error_handler_error_reporting = EG(user_error_handler_error_reporting);
1469-
EG(user_error_handler_error_reporting) = 0;
1470-
1471-
zend_emit_recorded_errors_ex(num_errors, errors);
1472-
1473-
EG(user_error_handler_error_reporting) = orig_user_error_handler_error_reporting;
1474-
EG(record_errors) = orig_record_errors;
1475-
EG(num_errors) = num_errors;
1476-
EG(errors) = errors;
1477-
}
1456+
if ((type & E_FATAL_ERRORS) && !(type & E_DONT_BAIL) && EG(num_errors)) {
1457+
uint32_t num_errors = EG(num_errors);
1458+
zend_error_info **errors = EG(errors);
1459+
EG(num_errors) = 0;
1460+
EG(errors) = NULL;
1461+
1462+
bool orig_record_errors = EG(record_errors);
1463+
EG(record_errors) = false;
1464+
1465+
/* Disable user error handler before emitting delayed errors, as
1466+
* it's unsafe to execute user code after a fatal error. */
1467+
int orig_user_error_handler_error_reporting = EG(user_error_handler_error_reporting);
1468+
EG(user_error_handler_error_reporting) = 0;
1469+
1470+
zend_emit_recorded_errors_ex(num_errors, errors);
1471+
1472+
EG(user_error_handler_error_reporting) = orig_user_error_handler_error_reporting;
1473+
EG(record_errors) = orig_record_errors;
1474+
EG(num_errors) = num_errors;
1475+
EG(errors) = errors;
14781476
}
14791477

14801478
if (EG(record_errors)) {

0 commit comments

Comments
 (0)