LibWasm: Make sure no duplicate export names are possible

This commit is contained in:
Diego 2024-06-10 13:28:41 -07:00 committed by Ali Mohammad Pur
parent e64ac8c177
commit 3d7c824607
Notes: sideshowbarker 2024-07-17 03:03:37 +09:00

View File

@ -25,9 +25,10 @@ ErrorOr<void, ValidationError> Validator::validate(Module& module)
if (result.is_error())
return;
for (auto& export_ : section.entries()) {
if (seen_export_names.try_set(export_.name()).release_value_but_fixme_should_propagate_errors() != AK::HashSetResult::InsertedNewEntry)
if (seen_export_names.try_set(export_.name()).release_value_but_fixme_should_propagate_errors() != AK::HashSetResult::InsertedNewEntry) {
result = Errors::duplicate_export_name(export_.name());
return;
return;
}
}
});
if (result.is_error()) {