mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-23 04:16:42 +00:00
Do not crash on empty structures
llvm-svn: 9195
This commit is contained in:
parent
2bd92e1721
commit
67a86ccbed
@ -53,6 +53,11 @@ const Type *getStructOffsetType(const Type *Ty, unsigned &Offset,
|
||||
uint64_t ThisOffset;
|
||||
const Type *NextType;
|
||||
if (const StructType *STy = dyn_cast<StructType>(Ty)) {
|
||||
if (STy->getElementTypes().empty()) {
|
||||
Offset = 0;
|
||||
return STy;
|
||||
}
|
||||
|
||||
ThisOffset = Offset;
|
||||
NextType = getStructOffsetStep(STy, ThisOffset, Indices, TD);
|
||||
} else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user