mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibWasm: Respect instance.types() bounds
This commit is contained in:
committed by
Jelle Raaijmakers
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()];
|
||||
|
||||
Reference in New Issue
Block a user