Skip to content

Commit ca98305

Browse files
Treat xxx_HAS_xxx as not a constructor, like xxx_IS_xxx etc.
Signed-off-by: Gilles Peskine <[email protected]>
1 parent 954783c commit ca98305

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/mbedtls_framework/macro_collector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def record_algorithm_subtype(self, name: str, expansion: str) -> None:
281281

282282
# Macro that is a destructor, not a constructor (i.e. takes a thing as
283283
# an argument and analyzes it, rather than constructing a thing).
284-
_destructor_name_re = re.compile(r'.*(_GET_|_IS_)|.*_LENGTH\Z')
284+
_destructor_name_re = re.compile(r'.*(_GET_|_HAS_|_IS_)|.*_LENGTH\Z')
285285

286286
# Macro that converts between things, rather than building a thing from
287287
# scratch.
@@ -476,7 +476,7 @@ def get_names(self, type_word: str) -> Set[str]:
476476
r'(PSA_((?:(?:DH|ECC|KEY)_)?[A-Z]+)_\w+)' +
477477
r'(?:\(([^\n()]*)\))?')
478478
# Regex of macro names to exclude.
479-
_excluded_name_re = re.compile(r'_(?:GET|IS|OF)_|_(?:BASE|FLAG|MASK)\Z')
479+
_excluded_name_re = re.compile(r'_(?:GET|HAS|IS|OF)_|_(?:BASE|FLAG|MASK)\Z')
480480
# Additional excluded macros.
481481
_excluded_names = set([
482482
# Macros that provide an alternative way to build the same

0 commit comments

Comments
 (0)