Skip to content

Commit

Permalink
LibWasm: Make sure no duplicate export names are possible
Browse files Browse the repository at this point in the history
  • Loading branch information
dzfrias authored and alimpfard committed Jun 10, 2024
1 parent e64ac8c commit 3d7c824
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 3d7c824

Please sign in to comment.