diff options
author | Tacet <advenam.tacet@trailofbits.com> | 2024-01-08 18:02:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-08 18:02:17 +0100 |
commit | c68a9d25e99a096f6862fc4b57dd380a21245d31 (patch) | |
tree | d5fa1201accb9972349d44ca1e1651698f16857f /clang/lib/Lex/ModuleMap.cpp | |
parent | 0e7199cf3d08c83d18549c9cd083e9fec6e9db54 (diff) | |
download | llvm-c68a9d25e99a096f6862fc4b57dd380a21245d31.zip llvm-c68a9d25e99a096f6862fc4b57dd380a21245d31.tar.gz llvm-c68a9d25e99a096f6862fc4b57dd380a21245d31.tar.bz2 |
[ASan][libc++] String annotations optimizations fix with lambda (#76200)
This commit addresses optimization and instrumentation challenges
encountered within comma constructors.
1) _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS does not work in comma
constructors.
2) Code inside comma constructors is not always correctly optimized.
Problematic code examples:
- `: __r_(((__str.__is_long() ? 0 : (__str.__annotate_delete(), 0)),
std::move(__str.__r_))) {`
- `: __r_(__r_([&](){ if(!__s.__is_long()) __s.__annotate_delete();
return std::move(__s.__r_);}())) {`
However, lambda with argument seems to be correctly optimized. The patch employs this.
Use of lambda based on an idea from @ldionne.
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
0 files changed, 0 insertions, 0 deletions