From 8657acc07e614b5fa7300a2a8e623c2fe36872f5 Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Fri, 12 Dec 2003 05:13:05 +0000 Subject: [PATCH] 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. llvm-svn: 10426 --- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp index 732a485d7831..abade5f857a0 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -706,8 +706,7 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, gep_type_iterator I, if (const StructType *STy = dyn_cast(*I)) { const StructLayout *SLO = TD.getStructLayout(STy); - // Indices must be ubyte constants... - const ConstantUInt *CPU = cast(*I); + const ConstantUInt *CPU = cast(I.getOperand()); unsigned Index = CPU->getValue(); Total += SLO->MemberOffsets[Index];