diff options
author | Guy David <49722543+guy-david@users.noreply.github.com> | 2025-03-15 20:55:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-15 20:55:29 +0200 |
commit | 316811060775f3d6284b5bb21cf7ea727fc2254d (patch) | |
tree | 56b6d706eb5c331a15a1bb2c61abddf7ac924774 /llvm/lib/Transforms/Utils/CloneFunction.cpp | |
parent | 37a57ca257c18ee7c3d8f4afae39aac7803e2bb7 (diff) | |
download | llvm-316811060775f3d6284b5bb21cf7ea727fc2254d.zip llvm-316811060775f3d6284b5bb21cf7ea727fc2254d.tar.gz llvm-316811060775f3d6284b5bb21cf7ea727fc2254d.tar.bz2 |
[AddressSanitizer] Remove memory effects from functions (#130495)
If left as-is, subsequent optimizations might utilize the possible
memory effects and optimize-out the instrumentation. Think of the
following case:
```
store i8 4, ptr %shadow
call void @llvm.lifetime.start.p0(i64 4, ptr %local)
%28 = call void @foo(ptr %local)
store i8 -8, ptr %shadow
call void @llvm.lifetime.end.p0(i64 4, ptr %local)
```
where `foo` is an external function with `memory(argmem: write)`. A pass
such as DeadStoreElimination is allowed to remove the initial store,
which might fail sanitizer checks within `foo`.
My first attempt was to add a `memory(readwrite)` at the call-site
level, but unfortunately the current implementation of
`getMemoryEffects` doesn't exactly give it "precedence" as specified,
but rather restricts the access specified by the call-site and not the
other way around as well.
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
0 files changed, 0 insertions, 0 deletions