OSDN Git Service

Merging r229352:
authorTom Stellard <thomas.stellard@amd.com>
Tue, 17 Mar 2015 18:09:58 +0000 (18:09 +0000)
committerWuZhen <wuzhen@jidemail.com>
Tue, 23 Feb 2016 11:30:49 +0000 (19:30 +0800)
commita8f203589d1d9e912b2f19997c9d56b1b2bda987
tree516b353650bc83290050d138f51557c65f6d24a5
parentff0685a8110f165f73f7f412a2bc727bc61b4248
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]