]> granicus.if.org Git - llvm/commit
Merging r229352:
authorTom Stellard <thomas.stellard@amd.com>
Tue, 17 Mar 2015 18:09:58 +0000 (18:09 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Tue, 17 Mar 2015 18:09:58 +0000 (18:09 +0000)
commit3f8396f9ba6a7aed66bb020ad589f2f59e30c3ec
treef33f3baf5c5df4b4ec3d1dc4501fd6066e624e09
parenta3bab355fb9502daea77934636ec794ec9f28ebb
Merging r229352:

------------------------------------------------------------------------
r229352 | david.majnemer | 2015-02-15 23:02:09 -0500 (Sun, 15 Feb 2015) | 9 lines

IR: Properly return nullptr when getAggregateElement is out-of-bounds

We didn't properly handle the out-of-bounds case for
ConstantAggregateZero and UndefValue.  This would manifest as a crash
when the constant folder was asked to fold a load of a constant global
whose struct type has no operands.

This fixes PR22595.

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@232512 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Constants.h
lib/IR/Constants.cpp
test/Transforms/InstSimplify/load.ll [new file with mode: 0644]