mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-30 06:52:52 +00:00
LibWasm: Clean up module sections API
Remove `for_each_section_of_type` in favor of making the module's sections defined as distinct fields. This means it is no longer possible to have two of the same section (which is invalid in WebAssembly, for anything other than custom sections).
This commit is contained in:
parent
9f24176cac
commit
23cfee2205
Notes:
github-actions[bot]
2024-08-01 10:20:10 +00:00
Author: https://github.com/dzfrias
Commit: 23cfee2205
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/895
Reviewed-by: https://github.com/alimpfard
7 changed files with 469 additions and 541 deletions
|
@ -182,7 +182,7 @@ JS::ThrowCompletionOr<NonnullOwnPtr<Wasm::ModuleInstance>> instantiate_module(JS
|
|||
TRY(import_name.type.visit(
|
||||
[&](Wasm::TypeIndex index) -> JS::ThrowCompletionOr<void> {
|
||||
dbgln("Trying to resolve a function {}::{}, type index {}", import_name.module, import_name.name, index.value());
|
||||
auto& type = module.type(index);
|
||||
auto& type = module.type_section().types()[index.value()];
|
||||
// FIXME: IsCallable()
|
||||
if (!import_.is_function())
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue