Skip to content

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Oct 5, 2025

Extract pgsql changes from #20066

Copy link
Member

@nielsdos nielsdos left a 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.

@Girgias
Copy link
Member Author

Girgias commented Oct 5, 2025

Blerg, really can't wait to get rid of this jank...

@Girgias Girgias force-pushed the pgsql-zpp-refacto branch from 8a745ec to 346df2d Compare October 5, 2025 12:18
@Girgias Girgias requested a review from nielsdos October 5, 2025 12:22
@Girgias Girgias marked this pull request as ready for review October 5, 2025 14:16
@Girgias Girgias requested a review from devnexen as a code owner October 5, 2025 14:16
Copy link
Member

@nielsdos nielsdos left a 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;
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants