-
Notifications
You must be signed in to change notification settings - Fork 8k
ext/pgsql: Refactor parameter parsing to remove manual usage of zend_wrong_parameters_count_error() #20068
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
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.
No, see 0a3442f and a previous commit of me.
Blerg, really can't wait to get rid of this jank... |
8a745ec
to
346df2d
Compare
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.
More readable indeed
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "P|z", &file_in, &oid) == SUCCESS) { | ||
link = FETCH_DEFAULT_LINK(); | ||
CHECK_DEFAULT_LINK(link); | ||
goto fn_body; |
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.
It would be great if this goto could be avoided.
Z_PARAM_LONG(result_type) | ||
ZEND_PARSE_PARAMETERS_END(); | ||
|
||
php_pgsql_fetch_hash(return_value, result, row, row_is_null, result_type); |
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.
row isn't initialized but is passed to this function, this is UB.
Z_PARAM_LONG_OR_NULL(row, row_is_null) | ||
ZEND_PARSE_PARAMETERS_END(); | ||
|
||
php_pgsql_fetch_hash(return_value, result, row, row_is_null, PGSQL_ASSOC); |
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.
row isn't initialized but is passed to this function, this is UB.
Z_PARAM_LONG(result_type) | ||
ZEND_PARSE_PARAMETERS_END(); | ||
|
||
php_pgsql_fetch_hash(return_value, result, row, row_is_null, result_type); |
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.
row isn't initialized but is passed to this function, this is UB.
must be allowed for compatibility */ | ||
php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, PGSQL_ASSOC, 1); | ||
zval dataset; | ||
php_pgsql_fetch_hash(&dataset, result, row, row_is_null, PGSQL_ASSOC); |
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.
row isn't initialized but is passed to this function, this is UB.
Extract pgsql changes from #20066