mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-15 21:41:58 +00:00
LibWasm: Respect instance.types() bounds
This commit is contained in:
parent
3c2bbd45cf
commit
e08f6a69b2
Notes:
github-actions[bot]
2024-12-09 11:31:30 +00:00
Author: https://github.com/shlyakpavel
Commit: e08f6a69b2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2838
1 changed files with 1 additions and 1 deletions
|
@ -17,7 +17,7 @@ namespace Wasm {
|
||||||
Optional<FunctionAddress> Store::allocate(ModuleInstance& instance, Module const& module, CodeSection::Code const& code, TypeIndex type_index)
|
Optional<FunctionAddress> Store::allocate(ModuleInstance& instance, Module const& module, CodeSection::Code const& code, TypeIndex type_index)
|
||||||
{
|
{
|
||||||
FunctionAddress address { m_functions.size() };
|
FunctionAddress address { m_functions.size() };
|
||||||
if (type_index.value() > instance.types().size())
|
if (type_index.value() >= instance.types().size())
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
auto& type = instance.types()[type_index.value()];
|
auto& type = instance.types()[type_index.value()];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue