-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix collection of unfinished function call in fibers #10557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
ZEND_API ZEND_ATTRIBUTE_DEPRECATED HashTable *zend_unfinished_execution_gc(zend_execute_data *execute_data, zend_execute_data *call, zend_get_gc_buffer *gc_buffer) | ||
{ | ||
bool suspended_by_yield = false; | ||
|
||
if (Z_TYPE_INFO(EX(This)) & ZEND_CALL_GENERATOR) { | ||
ZEND_ASSERT(EX(return_value)); | ||
|
||
/* The generator object is stored in EX(return_value) */ | ||
zend_generator *generator = (zend_generator*) EX(return_value); | ||
ZEND_ASSERT(execute_data == generator->execute_data); | ||
|
||
suspended_by_yield = !(generator->flags & ZEND_GENERATOR_CURRENTLY_RUNNING); | ||
} | ||
|
||
return zend_unfinished_execution_gc_ex(execute_data, call, gc_buffer, suspended_by_yield); | ||
} | ||
|
||
ZEND_API HashTable *zend_unfinished_execution_gc_ex(zend_execute_data *execute_data, zend_execute_data *call, zend_get_gc_buffer *gc_buffer, bool suspended_by_yield) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This avoids breaking ABI, although zend_unfinished_execution_gc was only introduced in the last patch release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ABI number is the last time ABI was broken (which defacto is every minor version). Here ABI is not broken, but the original function preserved and a new one added. Hence it's a non-issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I don't know how ABI breaks are meant to be handled for stuff released after GA.
Not at all; keeping ABI compat after first GA of a minor is a pretty strict policy (otherwise all extensions etc. would need to be rebuilt).
But yeah, not an issue here.
Looks proper to me :-) Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge that, it seems the most proper fix for this.
Merged as d721dcc. |
Fixes GH-10496
See #10508 (comment)