Skip to content

Commit c733491

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Fix hard_timeout when zend-max-execution-timers is enabled
2 parents 4e0e88a + ed9430a commit c733491

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ PHP NEWS
55
- Core:
66
. Fixed bug GH-19765 (object_properties_load() bypasses readonly property
77
checks). (timwolla)
8+
. Fixed hard_timeout with --enable-zend-max-execution-timers. (Appla)
89

910
- Opcache:
1011
. Fixed bug GH-19669 (assertion failure in zend_jit_trace_type_to_info_ex).

Zend/zend_execute_API.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,9 @@ static void zend_set_timeout_ex(zend_long seconds, bool reset_signals) /* {{{ */
15701570
return;
15711571
}
15721572
#elif defined(ZEND_MAX_EXECUTION_TIMERS)
1573-
zend_max_execution_timer_settime(seconds);
1573+
if (seconds > 0) {
1574+
zend_max_execution_timer_settime(seconds);
1575+
}
15741576

15751577
if (reset_signals) {
15761578
sigset_t sigset;
@@ -1657,7 +1659,9 @@ void zend_unset_timeout(void) /* {{{ */
16571659
tq_timer = NULL;
16581660
}
16591661
#elif defined(ZEND_MAX_EXECUTION_TIMERS)
1660-
zend_max_execution_timer_settime(0);
1662+
if (EG(timeout_seconds)) {
1663+
zend_max_execution_timer_settime(0);
1664+
}
16611665
#elif defined(HAVE_SETITIMER)
16621666
if (EG(timeout_seconds)) {
16631667
struct itimerval no_timeout;

0 commit comments

Comments
 (0)