Skip to content

Commit 8657acc

Browse files
author
Brian Gaeke
committed
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
1 parent e60a028 commit 8657acc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/ExecutionEngine/Interpreter/Execution.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,8 +706,7 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, gep_type_iterator I,
706706
if (const StructType *STy = dyn_cast<StructType>(*I)) {
707707
const StructLayout *SLO = TD.getStructLayout(STy);
708708

709-
// Indices must be ubyte constants...
710-
const ConstantUInt *CPU = cast<ConstantUInt>(*I);
709+
const ConstantUInt *CPU = cast<ConstantUInt>(I.getOperand());
711710
unsigned Index = CPU->getValue();
712711

713712
Total += SLO->MemberOffsets[Index];

0 commit comments

Comments
 (0)