llvm-project
30770432 - [CopyProf] Add libc interceptors.

Commit
1 day ago
[CopyProf] Add libc interceptors. A copy is reported as unnecessary if neither the object nor any memory it owns is modified before it is destroyed. So far, writes by uninstrumented code, most importantly library functions (e.g. `memcpy`, `memset`, etc.), are not accounted for, which leads to false positives. Interceptors make these writes visible. Additionally, objects constructed inside a d'tor are now marked as copy, so that destroying temporaries (e.g. a string built for a log message) does not suppress reports. Note that `strndup` and `realpath` are not intercepted yet, as their interceptors allocate memory via the `malloc` interceptor, which is only added in a subsequent patch. RFC: https://discourse.llvm.org/t/rfc-copysanitizer-csan-detecting-unneccessary-object-copies-at-runtime/91038 Previous PR: #225905
Author
Committer
Parents
Loading