Skip to content

gen_stub: Intern the parameter name string for named arguments in internal attributes #14595

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
Jun 19, 2024

Conversation

TimWolla
Copy link
Member

This is necessary because zend_get_attribute_object() will use the persistent string with the parameter name as the index for a newly created non-persistent HashTable, which is not legal.

As parameter names are expected to be short-ish, reasonably common terms and need to sit around in memory anyways, we might as well make them an interned string, circumstepping the issue without needing to duplicate the parameter name into a non-persistent string.


Found by @Girgias during review of #11293.

…ernal attributes

This is necessary because `zend_get_attribute_object()` will use the persistent
string with the parameter name as the index for a newly created non-persistent
HashTable, which is not legal.

As parameter names are expected to be short-ish, reasonably common terms and
need to sit around in memory anyways, we might as well make them an interned
string, circumstepping the issue without needing to duplicate the parameter
name into a non-persistent string.
@TimWolla TimWolla merged commit a1ea464 into php:master Jun 19, 2024
10 of 11 checks passed
@TimWolla TimWolla deleted the arginfo-attribute-interned-string branch June 19, 2024 06:06
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