aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-12-12 05:13:05 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-12-12 05:13:05 +0000
commit2798cd077a4a754064755ca82ad14434daea59fe (patch)
treee992b47c22c15e219e5e2e5391a47652d80aaeea /lib/ExecutionEngine
parent246372f35d6e7025e7ff16ce8d7543e961800a0e (diff)
downloadexternal_llvm-2798cd077a4a754064755ca82ad14434daea59fe.zip
external_llvm-2798cd077a4a754064755ca82ad14434daea59fe.tar.gz
external_llvm-2798cd077a4a754064755ca82ad14434daea59fe.tar.bz2
Since we are using a gep_type_iterator, we apparently must get the type
index by using I.getOperand() here. This was failing an assertion on basically every struct access. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10426 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 732a485..abade5f 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -706,8 +706,7 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, gep_type_iterator I,
if (const StructType *STy = dyn_cast<StructType>(*I)) {
const StructLayout *SLO = TD.getStructLayout(STy);
- // Indices must be ubyte constants...
- const ConstantUInt *CPU = cast<ConstantUInt>(*I);
+ const ConstantUInt *CPU = cast<ConstantUInt>(I.getOperand());
unsigned Index = CPU->getValue();
Total += SLO->MemberOffsets[Index];