Skip to content

Commit ceff85d

Browse files
committed
Revert "avoid-uaf"
This reverts commit 8c5e573.
1 parent 52d42fa commit ceff85d

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

toolchain/check/impl_lookup.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static auto FindAndDiagnoseImplLookupCycle(
184184
}
185185

186186
struct InterfacesFromConstantId {
187-
llvm::SmallVector<SemIR::SpecificInterface> interfaces;
187+
llvm::ArrayRef<SemIR::SpecificInterface> interfaces;
188188
SemIR::BuiltinConstraintMask builtin_constraint_mask;
189189
bool other_requirements;
190190
};
@@ -211,14 +211,9 @@ static auto GetInterfacesFromConstantId(
211211
if (!identified_id.has_value()) {
212212
return std::nullopt;
213213
}
214-
// TODO: IdentifiedFacetTypes are held in a RelationalValueStore which does
215-
// not protect against UAF through reallocation, so we must copy data out of
216-
// it.
217-
llvm::SmallVector<SemIR::SpecificInterface> interfaces(
218-
context.identified_facet_types()
219-
.Get(identified_id)
220-
.required_interfaces());
221-
return {{.interfaces = std::move(interfaces),
214+
return {{.interfaces = context.identified_facet_types()
215+
.Get(identified_id)
216+
.required_interfaces(),
222217
.builtin_constraint_mask = facet_type_info.builtin_constraint_mask,
223218
.other_requirements = facet_type_info.other_requirements}};
224219
}

0 commit comments

Comments
 (0)