-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Conversation
There was a problem hiding this 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])) { |
There was a problem hiding this comment.
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.
Thanks for the reviews Merged in 55a88f3 |
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...)