[SROA] Fix the loop exit placement to be prior to indexing the splits
authorChandler Carruth <chandlerc@gmail.com>
Fri, 2 Jan 2015 00:10:22 +0000 (00:10 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 2 Jan 2015 00:10:22 +0000 (00:10 +0000)
commit987c1f8ee7b412ac1c9bb31aafbcf06f761f921c
treec96ce05dc8343a1f97898488983adcad714c3fdd
parented3f2c6761806946c94431e7628cc6a59fe058f8
[SROA] Fix the loop exit placement to be prior to indexing the splits
array. This prevents it from walking out of bounds on the splits array.

Bug found with the existing tests by ASan and by the MSVC debug build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225069 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SROA.cpp