llvm-project
49e8f7a9 - [BoundsSafety] Support the counted_by family on function parameters

Commit
1 day ago
[BoundsSafety] Support the counted_by family on function parameters Allow counted_by, sized_by and their _or_null variants on function parameters. The count is parsed where it is written, so it names a parameter declared before the annotated one. With -fexperimental-late-parse-attributes, a count written after the declarator is parsed at the end of the parameter list. - The count must name a parameter of the function, or of an enclosing function declarator. - Counts on K&R parameter declarations are dropped. - Objective-C method parameters are checked the same way. - Array parameters, out parameters and dereferenced counts are not supported yet. The checks that the count is an integer and a plain reference to a declaration are shared with fields. CodeGen does not use parameter counts yet: they bound neither -fsanitize=array-bounds nor __builtin_dynamic_object_size.
Author
Parents
Loading