Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit fixes a timeout that was found by OSS-Fuzz recently where a module was calling `memory.grow` many times, presumably in a loop, with a modest amount each time. This meant that `memory.grow` was taking, in total, a quadratic amount of time because Wasmtime was configured with dynamic memories and no memory was reserved for growth. That in turn meant that the test case eventually timed out due to this quadratic behavior. To fix this in addition to the memory allocation cap that we already track a new cap for the number of times memories/tables can be grown was also added. Any growth beyond this limit is rejected and helps prevent this quadratic behavior.
- Loading branch information