From 49951165f01dae1ca669361b268fd9f599ed332e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 12 Apr 2022 13:50:00 +0200 Subject: [PATCH] Add zend_mark_function_parameter_as_sensitive() --- Zend/zend_attributes.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Zend/zend_attributes.h b/Zend/zend_attributes.h index 7b6c919527d..6ffd3d89f94 100644 --- a/Zend/zend_attributes.h +++ b/Zend/zend_attributes.h @@ -116,6 +116,19 @@ static zend_always_inline zend_attribute *zend_add_class_constant_attribute(zend return zend_add_attribute(&c->attributes, name, argc, flags, 0, 0); } +static zend_always_inline zend_attribute *zend_mark_function_parameter_as_sensitive(const HashTable *table, const char *func_name, uint32_t parameter) +{ + zend_function *func = zend_hash_str_find_ptr(table, func_name, strlen(func_name)); + ZEND_ASSERT(func != NULL); + + return zend_add_parameter_attribute( + func, + parameter, + zend_ce_sensitive_parameter->name, + 0 + ); +} + void zend_register_attribute_ce(void); void zend_attributes_shutdown(void);