diff --git a/llvm/lib/CheerpUtils/TypeOptimizer.cpp b/llvm/lib/CheerpUtils/TypeOptimizer.cpp index 0d9bb1099d6a..5093268695f8 100644 --- a/llvm/lib/CheerpUtils/TypeOptimizer.cpp +++ b/llvm/lib/CheerpUtils/TypeOptimizer.cpp @@ -273,7 +273,8 @@ void TypeOptimizer::gatherAllTypesInfo(const Module& M) { for (uint32_t i = firstBase; i< (firstBase + baseCount); i++) { - assert(sTy->getElementType(i)->isStructTy()); + if (!sTy->getElementType(i)->isStructTy()) + continue; uncollapsibleSecondaryBases.insert(sTy->getElementType(i)); } }