[CGCall] Fix potential invalid iterator decrement in findDominatingStoreToReturnValue.
authorAlexey Samsonov <vonosmas@gmail.com>
Fri, 12 Jun 2015 21:05:32 +0000 (21:05 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Fri, 12 Jun 2015 21:05:32 +0000 (21:05 +0000)
commit1054420ba3b908ade5ef654c4cb82f174a8430c4
tree8da94bd51f15cf4bfd7b38abfd2728877bb80fa6
parent12a1910e875865492b2515d4bdcde48b1a2e72fd
[CGCall] Fix potential invalid iterator decrement in findDominatingStoreToReturnValue.

If llvm.lifetime.end turns out to be the first instruction in the last
basic block, we can decrement the iterator twice, going past rend.
At the moment, this can never happen because llvm.lifetime.end always
goes immediately after bitcast, but relying on this is very brittle.

llvm-svn: 239638
clang/lib/CodeGen/CGCall.cpp