Skip to content

Commit 8795981

Browse files
committed
[RemoteMirrors] Clear the Demangler on each iteration of the loop in getFieldTypeInfo. Otherwise the Demangler can end up allocating hundreds of megabytes of memory.
rdar://problem/40826018
1 parent aea6f06 commit 8795981

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/public/Reflection/TypeRefBuilder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ TypeRefBuilder::getFieldTypeInfo(const TypeRef *TR) {
160160
auto CandidateMangledName = FD.getMangledTypeName(TypeRefOffset);
161161
auto NormalizedName = normalizeReflectionName(Dem, CandidateMangledName);
162162
FieldTypeInfoCache[NormalizedName] = {&FD, &Info};
163+
Dem.clear();
163164
}
164165
}
165166

0 commit comments

Comments
 (0)