forked from OSchip/llvm-project
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:
parent
e60a0289d4
commit
8657acc07e
|
@ -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];
|
||||||
|
|
Loading…
Reference in New Issue