Skip to content

Commit

Permalink
Improve exception handling in memory.grow instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 committed Feb 17, 2021
1 parent d0d1424 commit 94791c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/fizzy/execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,10 +837,10 @@ ExecutionResult execute(Instance& instance, FuncIdx func_idx, const Value* args,
try
{
if (new_pages > instance.memory_pages_limit)
throw std::bad_alloc();
throw std::length_error("");
memory->resize(new_pages * PageSize);
}
catch (std::bad_alloc const&)
catch (const std::length_error&)
{
ret = static_cast<uint32_t>(-1);
}
Expand Down

0 comments on commit 94791c7

Please sign in to comment.