Skip to content

Commit 7149b30

Browse files
committed
Merge branch 'true-async-api' into true-async
2 parents 8bebdb2 + aadca21 commit 7149b30

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Zend/zend_async_API.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -701,16 +701,13 @@ ZEND_API void zend_async_resume_when(
701701
zend_coroutine_event_callback_t *event_callback
702702
)
703703
{
704-
ZEND_ASSERT(EG(exception) == NULL && "Cannot resume when there is an active exception in the engine.");
705-
706-
if (UNEXPECTED(EG(exception))) {
707-
return;
708-
}
704+
zend_exception_save();
709705

710706
bool locally_allocated_callback = false;
711707

712708
if (UNEXPECTED(ZEND_ASYNC_EVENT_IS_CLOSED(event))) {
713709
zend_throw_error(NULL, "The event cannot be used after it has been terminated");
710+
zend_exception_restore();
714711
return;
715712
}
716713

@@ -721,6 +718,7 @@ ZEND_API void zend_async_resume_when(
721718
event->dispose(event);
722719
}
723720

721+
zend_exception_restore();
724722
return;
725723
}
726724

@@ -755,6 +753,7 @@ ZEND_API void zend_async_resume_when(
755753
event->dispose(event);
756754
}
757755

756+
zend_exception_restore();
758757
return;
759758
}
760759

@@ -799,6 +798,8 @@ ZEND_API void zend_async_resume_when(
799798
}
800799
}
801800
}
801+
802+
zend_exception_restore();
802803
}
803804

804805
ZEND_API void zend_async_waker_callback_resolve(

0 commit comments

Comments
 (0)