mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-26 04:34:41 +00:00
Add verification of union types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97889 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e765f2b5e3
commit
e20ab4a03c
@ -1525,6 +1525,15 @@ void Verifier::VerifyType(const Type *Ty) {
|
||||
VerifyType(ElTy);
|
||||
}
|
||||
} break;
|
||||
case Type::UnionTyID: {
|
||||
const UnionType *UTy = cast<UnionType>(Ty);
|
||||
for (unsigned i = 0, e = UTy->getNumElements(); i != e; ++i) {
|
||||
const Type *ElTy = UTy->getElementType(i);
|
||||
Assert2(UnionType::isValidElementType(ElTy),
|
||||
"Union type with invalid element type", ElTy, UTy);
|
||||
VerifyType(ElTy);
|
||||
}
|
||||
} break;
|
||||
case Type::ArrayTyID: {
|
||||
const ArrayType *ATy = cast<ArrayType>(Ty);
|
||||
Assert1(ArrayType::isValidElementType(ATy->getElementType()),
|
||||
|
Loading…
x
Reference in New Issue
Block a user