OSDN Git Service

Do not remove empty lifetime.start/lifetime.end ranges
authorVitaly Buka <vitalybuka@google.com>
Thu, 28 Jul 2016 22:50:48 +0000 (22:50 +0000)
committerVitaly Buka <vitalybuka@google.com>
Thu, 28 Jul 2016 22:50:48 +0000 (22:50 +0000)
commitbbc7125e70ecf268bbc5bfb8215c08eaf32233b9
tree8298e391eec1c399c2e85e80c4f47f676c61eda6
parent1e88bcadc36b12d60a1eca3263ec222eefc7d2b2
Do not remove empty lifetime.start/lifetime.end ranges

Summary:
Asan stack-use-after-scope check should poison alloca even if there is
no access between start and end.

This is possible for code like this:
for (int i = 0; i < 3; i++) {
  int x;
  p = &x;
}

"Loop Invariant Code Motion" will move "p = &x;" out of the loop, making
start/end range empty.

PR27453

Reviewers: eugenis

Differential Revision: https://reviews.llvm.org/D22842

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277068 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCalls.cpp
test/Transforms/InstCombine/lifetime-asan.ll