diff options
author | Vitaly Buka <vitalybuka@google.com> | 2016-07-22 22:04:38 +0000 |
---|---|---|
committer | Vitaly Buka <vitalybuka@google.com> | 2016-07-22 22:04:38 +0000 |
commit | e3a032a7408ccff451cb5c081511797e05dca162 (patch) | |
tree | 4dfdb955c8e60c185b06f53d1bba4dc3ae409d56 /llvm/lib/Transforms | |
parent | ba21ffebff540841da6c8847fcecd82ae734038d (diff) | |
download | bcm5719-llvm-e3a032a7408ccff451cb5c081511797e05dca162.tar.gz bcm5719-llvm-e3a032a7408ccff451cb5c081511797e05dca162.zip |
Unpoison stack before resume instruction
Summary:
Clang inserts cleanup code before resume similar way as before return instruction.
This makes asan poison local variables causing false use-after-scope reports.
__asan_handle_no_return does not help here as it was executed before
llvm.lifetime.end inserted into resume block.
To avoid false report we need to unpoison stack for resume same way as for return.
PR27453
Reviewers: kcc, eugenis
Differential Revision: https://reviews.llvm.org/D22661
llvm-svn: 276480
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 27b68b0387d..0dbd5c000fe 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -676,6 +676,12 @@ struct FunctionStackPoisoner : public InstVisitor<FunctionStackPoisoner> { /// \brief Collect all Ret instructions. void visitReturnInst(ReturnInst &RI) { RetVec.push_back(&RI); } + /// \brief Collect all Resume instructions. + void visitResumeInst(ResumeInst &RI) { RetVec.push_back(&RI); } + + /// \brief Collect all CatchReturnInst instructions. + void visitCleanupReturnInst(CleanupReturnInst &CRI) { RetVec.push_back(&CRI); } + void unpoisonDynamicAllocasBeforeInst(Instruction *InstBefore, Value *SavedStack) { IRBuilder<> IRB(InstBefore); |