[compiler-rt] [llvm] [ASan] Do not instrument catch block parameters on Windows (PR #159618)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 23 06:19:27 PDT 2025
================
@@ -2986,6 +2987,24 @@ void AddressSanitizer::markEscapedLocalAllocas(Function &F) {
}
}
}
+// Mitigation for https://github.com/google/sanitizers/issues/749
+// We don't instrument Windows catch-block parameters to avoid
+// interfering with exception handling assumptions.
+void AddressSanitizer::markCatchParametersAsUninteresting(Function &F) {
----------------
antoniofrighetto wrote:
Following up on Reid's suggestion, I think your previous approach of checking whether the alloca is interesting looks correct to me. We should just avoid walking alloca's uses, and instead look for catchpads, whose arguments may be allocas.
We may want to maintain an additional `CatchPadParamsAlloca` set of such allocas, populate it once during initialization, then the extra check in `isInterestingAlloca` should be something like:
```cpp
!(TargetTriple.isOSWindows() && CatchPadParamsAlloca.count(&AI)));
```
https://github.com/llvm/llvm-project/pull/159618
More information about the llvm-commits
mailing list