Split fiber status and flags (#7094)

Co-Authored-By: twosee <twose@qq.com>
This commit is contained in:
Aaron Piotrowski 2021-06-03 15:34:48 -05:00 committed by GitHub
parent b601acf35e
commit d2e5203865
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 40 deletions

View file

@ -6873,7 +6873,7 @@ ZEND_METHOD(ReflectionFiber, getFiber)
}
#define REFLECTION_CHECK_VALID_FIBER(fiber) do { \
if (fiber == NULL || fiber->status == ZEND_FIBER_STATUS_INIT || fiber->status & ZEND_FIBER_STATUS_FINISHED) { \
if (fiber == NULL || fiber->status == ZEND_FIBER_STATUS_INIT || fiber->status == ZEND_FIBER_STATUS_DEAD) { \
zend_throw_error(NULL, "Cannot fetch information from a fiber that has not been started or is terminated"); \
RETURN_THROWS(); \
} \
@ -6948,7 +6948,7 @@ ZEND_METHOD(ReflectionFiber, getCallable)
ZEND_PARSE_PARAMETERS_NONE();
if (fiber == NULL || fiber->status & ZEND_FIBER_STATUS_FINISHED) {
if (fiber == NULL || fiber->status == ZEND_FIBER_STATUS_DEAD) {
zend_throw_error(NULL, "Cannot fetch the callable from a fiber that has terminated"); \
RETURN_THROWS();
}