Skip to content

Commit df31c7d

Browse files
author
Advenam Tacet
committed
[ASan][libc++] Update string ASan annotations to Zero-overhead
This commit introduces Zero-overhead string ASan annotations by wrapping every call to ASan helper functions inside a constexpr if statement. This ensures that ASan checks are only performed at runtime when the compiler determines that the string is potentially vulnerable to memory safety issues. This approach significantly reduces the overhead of ASan while maintaining its effectiveness in detecting memory safety bugs. While the intended execution path should not incur any overhead due to compiler optimizations, a few local variables solely accessed by ASan helper functions are not currently removed and we rely on optimizing them away. A future commit may reduce number of these variables.
1 parent 36b6f77 commit df31c7d

File tree

1 file changed

+101
-85
lines changed

1 file changed

+101
-85
lines changed

0 commit comments

Comments
 (0)