-
Notifications
You must be signed in to change notification settings - Fork 8k
Zend: Remove unused parameter from zend_dval_to_lval_cap() #21112
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
base: master
Are you sure you want to change the base?
Conversation
iluuu1994
left a comment
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.
LGTM. Please document the API change in UPGRADING.INTERNALS.
Zend/zend_operators.c
Outdated
| lval = zend_dval_to_lval_cap(dval, op_str); | ||
| lval = zend_dval_to_lval_cap(dval); | ||
| if (!zend_is_long_compatible(dval, lval)) { | ||
| if (op_str == 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.
Do we still need to make a copy? I believe not?
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's an existing copy above, including a warning. So I think yes. Technically not here, but then we need to know whether to free or not, which is likely not worth the trouble.
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 still don't understand. zend_tmp_string_release already checks whether we need to free.
zend_incompatible_string_to_long_error triggers a warning that uses op as a string, even if that invalidates op, then the warning will have already been triggered.
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.e. you could do zend_incompatible_string_to_long_error(op_str ? op_str : Z_STR_P(op));
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, that's what you mean. Would also be fine by me.
The `zend_string *s` parameter became unused after commit f754ffa (phpGH-20746) removed the `zend_oob_string_to_long_error()` calls. This fixes an unused-parameter compiler warning and updates a stale comment in zend_operators.c that incorrectly stated this function can emit warnings.
The
zend_string *sparameter became unused after commit f754ffa (GH-20746) removed thezend_oob_string_to_long_error()calls.This fixes an unused-parameter compiler warning and updates a stale comment in zend_operators.c that incorrectly stated this function can emit warnings.