Skip to content

Commit c077455

Browse files
committed
Use a SmallMapVector instead of a SmallDenseMap
validateCodingKeysEnum cannot iterate over a hashed collection without ordering guarantees.
1 parent 9da6d92 commit c077455

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/DerivedConformanceCodable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static bool validateCodingKeysEnum(DerivedConformance &derived,
143143

144144
// Here we'll hold on to properties by name -- when we've validated a property
145145
// against its CodingKey entry, it will get removed.
146-
llvm::SmallDenseMap<Identifier, VarDecl *, 8> properties;
146+
llvm::SmallMapVector<Identifier, VarDecl *, 8> properties;
147147
for (auto *varDecl : derived.Nominal->getStoredProperties()) {
148148
if (!varDecl->isUserAccessible())
149149
continue;

0 commit comments

Comments
 (0)