Skip to content

add SensitiveParameter as known string and use it in arginfo #8991

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

Closed
wants to merge 1 commit into from

Conversation

remicollet
Copy link
Member

@remicollet remicollet commented Jul 13, 2022

Following PR #8836

To avoid so much (148) init / release of the same string

notice, perhaps some others may be added later (AllowDynamicProperties only used 2 or Attribute only used in zend_test...)

Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

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

As far as I am qualified to tell, this is a reasonable short-term solution.

$code .= "\tzend_string *attribute_name_{$escapedAttributeName}_$nameSuffix = zend_string_init(\"" . addcslashes($this->class, "\\") . "\", sizeof(\"" . addcslashes($this->class, "\\") . "\") - 1, 1);\n";
$code .= "\t" . ($this->args ? "zend_attribute *attribute_{$escapedAttributeName}_$nameSuffix = " : "") . "$invocation, attribute_name_{$escapedAttributeName}_$nameSuffix, " . count($this->args) . ");\n";
$code .= "\tzend_string_release(attribute_name_{$escapedAttributeName}_$nameSuffix);\n";
if (isset($knowns[$escapedAttributeName])) {
Copy link
Member

@kocsismate kocsismate Jul 18, 2022

Choose a reason for hiding this comment

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

First, I tried to use a similar approach in case of known strings when I started to work on generating properties, but then Nikita asked me to simply ignore them and only use normal strings. My guess is that we don't really need to deal with known strings if the string in question is allocated as permanent (?).

That's why I think it would be more future-proof to just collect all the different attribute names and declare them at once. As this would be slightly more difficult to implement, let's go with your known-string based approach for beta 1.

@remicollet
Copy link
Member Author

Thanks for the reviews

Merged in 55a88f3

@remicollet remicollet closed this Jul 18, 2022
@remicollet remicollet deleted the issue-sensitive branch July 18, 2022 09:44
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