CodeGen: move over-zealous assert into actual if statement.
authorTim Northover <tnorthover@apple.com>
Wed, 6 May 2015 20:07:38 +0000 (20:07 +0000)
committerTim Northover <tnorthover@apple.com>
Wed, 6 May 2015 20:07:38 +0000 (20:07 +0000)
commit84b8c10729836ab3247bfa256101ba846eaefd92
tree717fa793f888ea82d770c311620c3e958dc1c083
parent7838051bda3ee8b95c73c6d5e1a97ea3570684f1
CodeGen: move over-zealous assert into actual if statement.

It's quite possible to encounter an insertvalue instruction that's more deeply
nested than the value we're looking for, but when that happens we really
mustn't compare beyond the end of the index array.

Since I couldn't see any guarantees about what comparisons std::equal makes, we
probably need to directly check the size beforehand. In practice, I suspect
most std::equal implementations would probably bail early, which would be OK.
But just in case...

rdar://20834485

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236635 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/Analysis.cpp
test/CodeGen/AArch64/tail-call.ll