Skip to content

Make the fcc parameter const in zend_call_known_fcc #14259

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 1 commit into from
May 17, 2024

Conversation

TimWolla
Copy link
Member

This makes it legal to call the function from a caller that only has a const pointer to the fcc to prevent accidental modification.

This makes it legal to call the function from a caller that only has a `const`
pointer to the `fcc` to prevent accidental modification.
@TimWolla TimWolla requested a review from Girgias May 17, 2024 06:50
@TimWolla TimWolla requested a review from dstogov as a code owner May 17, 2024 06:50
@SakiTakamachi
Copy link
Member

Is it okay to target 8.3?

@iluuu1994
Copy link
Member

Should be ABI compatible, so yes. @TimWolla Is there a particular motivation for this? If this is backported, why to 8.3 and not 8.2?

@TimWolla
Copy link
Member Author

Is there a particular motivation for this?

I have a non-php-src case of FCC being embedded into a larger structure that I'd prefer to access via a const struct my_struct* to prevent me from accidentally writing into it.

If this is backported, why to 8.3 and not 8.2?

Because the function does not exist in 8.2. It was introduced in #9840.

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

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

Thanks for the explanation. LGTM then. 🙂

@TimWolla
Copy link
Member Author

CI failures appear unrelated, thus merging:

@TimWolla TimWolla merged commit a89d22c into php:PHP-8.3 May 17, 2024
6 of 9 checks passed
@TimWolla TimWolla deleted the zend-call-known-fcc-const branch May 17, 2024 14:14
TimWolla added a commit that referenced this pull request May 17, 2024
* PHP-8.3:
  Make the `fcc` parameter `const` in `zend_call_known_fcc` (#14259)
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