aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-02-20 19:26:55 +0000
committerDevang Patel <dpatel@apple.com>2008-02-20 19:26:55 +0000
commit7eb5d6b71d4cc47c153ddb18f2be51940442f87b (patch)
tree54f1cea5cf3671b2c4d47a86f356703f520f2b30 /lib/VMCore
parenteb293342b9749dc8bb8a95a86c35fbb1e9c60fee (diff)
downloadexternal_llvm-7eb5d6b71d4cc47c153ddb18f2be51940442f87b.zip
external_llvm-7eb5d6b71d4cc47c153ddb18f2be51940442f87b.tar.gz
external_llvm-7eb5d6b71d4cc47c153ddb18f2be51940442f87b.tar.bz2
getresult type is the type of indexed aggregate element
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47392 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Instructions.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index d700902..c1e5833 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -2708,7 +2708,7 @@ void SwitchInst::setSuccessorV(unsigned idx, BasicBlock *B) {
GetResultInst::GetResultInst(Value *Aggregate, unsigned Index,
const std::string &Name,
Instruction *InsertBef)
- : Instruction(Aggr->getType(),
+ : Instruction(cast<StructType>(Aggregate->getType())->getElementType(Index),
GetResult, &Aggr, 1, InsertBef) {
assert(isValidOperands(Aggregate, Index) && "Invalid GetResultInst operands!");
Aggr.init(Aggregate, this);