[asan] don't unpoison redzones on function exit in use-after-return mode.
authorKostya Serebryany <kcc@google.com>
Mon, 23 Dec 2013 14:15:08 +0000 (14:15 +0000)
committerKostya Serebryany <kcc@google.com>
Mon, 23 Dec 2013 14:15:08 +0000 (14:15 +0000)
commit26f1d1cbbce40b3b496d9264064a0ed467f763e6
tree1e067c758b5e396b6ee6aa5f9758024baf92c747
parent1fe014e5fcaf45dd1d26affa44a5c9579337f200
[asan] don't unpoison redzones on function exit in use-after-return mode.

Summary:
Before this change the instrumented code before Ret instructions looked like:
  <Unpoison Frame Redzones>
  if (Frame != OriginalFrame) // I.e. Frame is fake
     <Poison Complete Frame>

Now the instrumented code looks like:
  if (Frame != OriginalFrame) // I.e. Frame is fake
     <Poison Complete Frame>
  else
     <Unpoison Frame Redzones>

Reviewers: eugenis

Reviewed By: eugenis

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2458

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197907 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/BasicBlockUtils.h
lib/Transforms/Instrumentation/AddressSanitizer.cpp
lib/Transforms/Utils/BasicBlockUtils.cpp
test/Instrumentation/AddressSanitizer/stack-poisoning.ll [new file with mode: 0644]