Skip to content

ext/sqlite3: Use new F ZPP modifier #14040

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

Merged
merged 2 commits into from
May 1, 2024
Merged

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Apr 24, 2024

No description provided.

ZEND_PARSE_PARAMETERS_END();

SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
SQLITE3_CHECK_INITIALIZED_FREE_TRAMPOLINE(db_obj, db_obj->initialised, SQLite3, &fcc);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it need to check if the callback is passed null?

Comment on lines 1029 to 1034
if (ZEND_FCC_INITIALIZED(step_fcc)) {
zend_release_fcall_info_cache(&step_fcc);
}
if (ZEND_FCC_INITIALIZED(fini_fcc)) {
zend_release_fcall_info_cache(&fini_fcc);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ZEND_FCC_INITIALIZED is redundant because zend_release_fcall_info_cache is doing almost the same thing as checking ZEND_FCC_INITIALIZED.

Also, in cases like createAggregate(null, null, null), there is a possibility that uninitialized members (step_fcc.function_handler, fini_fcc.function_handler) may be accessed, so it may be a good idea to set them to NULL in advance.
(In a follow-up PR for pdo_sqlite, I ran into this problem in the release build)

@Girgias Girgias merged commit 6303d1f into php:master May 1, 2024
9 of 10 checks passed
@Girgias Girgias deleted the sqlite3-zpp-F branch May 1, 2024 14:38
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.

3 participants