-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Cleanup return values for Intl when parameter parsing is unsuccessful #4871
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
79817e7
to
18407e2
Compare
return; | ||
} | ||
|
||
if (convert_cp(&cp, zcp) == FAILURE) { | ||
RETURN_NULL(); |
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.
or should I just stay with return;
? 🤔
@@ -87,7 +87,6 @@ static void _php_intlgregcal_constructor_body( | |||
"|z!s!", &tz_object, &locale, &locale_len) == FAILURE) { | |||
if (!is_constructor) { | |||
zval_ptr_dtor(return_value); | |||
RETVAL_NULL(); |
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 needs to stay, otherwise you may get double frees. Same below.
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.
Or alternatively, you can drop the whole if (!is_constructor) { ... }
block.
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.
I've done this as part of e0be51d.
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.
Thanks! It is much better what I could have done ^^ Now, I am rebasing and fixing the other 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.
Done (although there is a test issue with fileowner
on ARM).
} | ||
|
||
if (index < (zend_long)INT32_MIN || index > (zend_long)INT32_MAX) { | ||
RETURN_NULL(); |
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.
Should be RETURN_FALSE
to preserve previous behavior (for now).
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.
Ah, yes. It was an oversight.
18407e2
to
a81feb6
Compare
No description provided.