mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWasm: Respect instance.types() bounds
This commit is contained in:
parent
3c2bbd45cf
commit
e08f6a69b2
|
|
@ -17,7 +17,7 @@ namespace Wasm {
|
|||
Optional<FunctionAddress> Store::allocate(ModuleInstance& instance, Module const& module, CodeSection::Code const& code, TypeIndex type_index)
|
||||
{
|
||||
FunctionAddress address { m_functions.size() };
|
||||
if (type_index.value() > instance.types().size())
|
||||
if (type_index.value() >= instance.types().size())
|
||||
return {};
|
||||
|
||||
auto& type = instance.types()[type_index.value()];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user