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
This commit is contained in:
Brian Gaeke 2003-12-12 05:13:05 +00:00
parent e60a0289d4
commit 8657acc07e
1 changed files with 1 additions and 2 deletions

View File

@ -706,8 +706,7 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, gep_type_iterator I,
if (const StructType *STy = dyn_cast<StructType>(*I)) { if (const StructType *STy = dyn_cast<StructType>(*I)) {
const StructLayout *SLO = TD.getStructLayout(STy); const StructLayout *SLO = TD.getStructLayout(STy);
// Indices must be ubyte constants... const ConstantUInt *CPU = cast<ConstantUInt>(I.getOperand());
const ConstantUInt *CPU = cast<ConstantUInt>(*I);
unsigned Index = CPU->getValue(); unsigned Index = CPU->getValue();
Total += SLO->MemberOffsets[Index]; Total += SLO->MemberOffsets[Index];