mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
PredictableMemOpt: Don't try to diagnose recursive value types.
They're invalid, and we don't want to blow the stack trying to decompose a type with infinite elements. Fixes rdar://problem/17920535. Swift SVN r23775
This commit is contained in:
@@ -31,6 +31,9 @@ STATISTIC(NumAllocRemoved, "Number of allocations completely removed");
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static unsigned getNumSubElements(SILType T, SILModule &M) {
|
||||
if (!M.getTypeLowering(T).isValid())
|
||||
return 0;
|
||||
|
||||
if (auto TT = T.getAs<TupleType>()) {
|
||||
unsigned NumElements = 0;
|
||||
for (auto index : indices(TT.getElementTypes()))
|
||||
|
||||
Reference in New Issue
Block a user