Commit d7ea768
Add clang::lifetimebound annotation to StringRef constructors. (llvm#113878)
Adding the lifetimebound annotation to the ArrayRef's array constructor
can enable us to detect the following use-after-free issues:
```
llvm::StringRef TestZoneName() {
char test[] = "foo"; // oops, missing static
return test; // use-after-free.
}
```
See llvm#1135331 parent e5419a8 commit d7ea768
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
0 commit comments