diff options
Diffstat (limited to 'lib/Target/TargetData.cpp')
-rw-r--r-- | lib/Target/TargetData.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index 41288ec671..1ebe5b5711 100644 --- a/lib/Target/TargetData.cpp +++ b/lib/Target/TargetData.cpp @@ -466,8 +466,7 @@ uint64_t TargetData::getIndexedOffset(const Type *ptrTy, Value* const* Indices, const StructLayout *Layout = getStructLayout(STy); // Add in the offset, as calculated by the structure layout info... - assert(FieldNo < Layout->MemberOffsets.size() &&"FieldNo out of range!"); - Result += Layout->MemberOffsets[FieldNo]; + Result += Layout->getElementOffset(FieldNo); // Update Ty to refer to current element Ty = STy->getElementType(FieldNo); |