mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibWasm: Report start function traps during instantiation
This commit is contained in:
parent
1e19be412f
commit
c2a0c4f581
Notes:
sideshowbarker
2024-07-17 01:51:00 +09:00
Author: https://github.com/dzfrias Commit: https://github.com/LadybirdBrowser/ladybird/commit/c2a0c4f581 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/185 Reviewed-by: https://github.com/alimpfard
1 changed files with 3 additions and 1 deletions
|
@ -425,7 +425,9 @@ InstantiationResult AbstractMachine::instantiate(Module const& module, Vector<Ex
|
|||
instantiation_result = InstantiationError { ByteString::formatted("Start section function referenced invalid index {} of max {} entries", index.value(), functions.size()) };
|
||||
return;
|
||||
}
|
||||
invoke(functions[index.value()], {});
|
||||
auto result = invoke(functions[index.value()], {});
|
||||
if (result.is_trap())
|
||||
instantiation_result = InstantiationError { ByteString::formatted("Start function trapped: {}", result.trap().reason) };
|
||||
});
|
||||
|
||||
if (instantiation_result.has_value())
|
||||
|
|
Loading…
Reference in a new issue