Commit 41bd98e7 authored by Eric Holk's avatar Eric Holk Committed by Commit Bot

[wasm fuzzer] generate grow_memory instructions

Change-Id: Ib9bbcc22afbfc4d143e0eb65b1399f118bbc1e36
Reviewed-on: https://chromium-review.googlesource.com/754334
Commit-Queue: Eric Holk <eholk@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49202}
parent 24e97955
......@@ -139,6 +139,8 @@ class WasmGenerator {
builder_->EmitWithU8(kExprMemorySize, 0);
}
void grow_memory(DataRange data);
using generate_fn = void (WasmGenerator::*const)(DataRange);
template <size_t N>
......@@ -289,8 +291,7 @@ void WasmGenerator::Generate<kWasmI32>(DataRange data) {
&WasmGenerator::memop<kExprI32LoadMem16U>,
&WasmGenerator::current_memory,
// TODO(eholk): add grow_memory too
};
&WasmGenerator::grow_memory};
GenerateOneOf(alternates, data);
}
......@@ -388,6 +389,11 @@ void WasmGenerator::Generate<kWasmF64>(DataRange data) {
GenerateOneOf(alternates, data);
}
void WasmGenerator::grow_memory(DataRange data) {
Generate<kWasmI32>(data);
builder_->EmitWithU8(kExprGrowMemory, 0);
}
void WasmGenerator::Generate(ValueType type, DataRange data) {
switch (type) {
case kWasmStmt:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment