1
0
mirror of https://github.com/RPCS3/llvm.git synced 2025-02-24 21:00:36 +00:00
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277066 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vitaly Buka 2016-07-28 22:50:43 +00:00
parent ad0220cb9b
commit e0d8738c93

@ -30,6 +30,8 @@ using namespace PatternMatch;
STATISTIC(NumSimplified, "Number of library calls simplified");
extern cl::opt<bool> ClUseAfterScope;
/// Return the specified type promoted as it would be to pass though a va_arg
/// area.
static Type *getPromotedType(Type *Ty) {
@ -1209,6 +1211,10 @@ static bool removeTriviallyEmptyRange(IntrinsicInst &I, unsigned StartID,
unsigned EndID, InstCombiner &IC) {
assert(I.getIntrinsicID() == StartID &&
"Start intrinsic does not have expected ID");
// Even if the range is empty asan need to poison memory to detect invalid
// access latter.
if (ClUseAfterScope)
return false;
BasicBlock::iterator BI(I), BE(I.getParent()->end());
for (++BI; BI != BE; ++BI) {
if (auto *E = dyn_cast<IntrinsicInst>(BI)) {