Update wasm-{smith,encoder} (#3835)
Ended up being a routine update but seemed good to go ahead and hook up updates. While I was at it I went ahead and hooked up multi-value swarm fuzzing as well now that wasm-smith implements it.
This commit is contained in:
15
Cargo.lock
generated
15
Cargo.lock
generated
@@ -1186,6 +1186,12 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "flagset"
|
||||||
|
version = "0.4.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cda653ca797810c02f7ca4b804b40b8b95ae046eb989d356bce17919a8c25499"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fnv"
|
name = "fnv"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
@@ -3315,20 +3321,21 @@ checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-encoder"
|
name = "wasm-encoder"
|
||||||
version = "0.6.0"
|
version = "0.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2caacc74c68c74f0008c4055cdf509c43e623775eaf73323bb818dcf666ed9bd"
|
checksum = "aa9d9bf45fc46f71c407837c9b30b1e874197f2dc357588430b21e5017d290ab"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"leb128",
|
"leb128",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-smith"
|
name = "wasm-smith"
|
||||||
version = "0.7.1"
|
version = "0.9.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ab0a268c3562548522a7f98e057715fa37d1a39349354220886de6796b8a8ad4"
|
checksum = "1bf1f1ae7d995f2d82326fda2c92deb2444fd3e59bf885fe9a4bbe9bde3b6c93"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arbitrary",
|
"arbitrary",
|
||||||
|
"flagset",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"leb128",
|
"leb128",
|
||||||
"wasm-encoder",
|
"wasm-encoder",
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ wasmparser = "0.82"
|
|||||||
wasmprinter = "0.2.32"
|
wasmprinter = "0.2.32"
|
||||||
wasmtime = { path = "../wasmtime" }
|
wasmtime = { path = "../wasmtime" }
|
||||||
wasmtime-wast = { path = "../wast" }
|
wasmtime-wast = { path = "../wast" }
|
||||||
wasm-encoder = "0.6.0"
|
wasm-encoder = "0.10.0"
|
||||||
wasm-smith = "0.7.0"
|
wasm-smith = "0.9.0"
|
||||||
wasm-spec-interpreter = { path = "./wasm-spec-interpreter" }
|
wasm-spec-interpreter = { path = "./wasm-spec-interpreter" }
|
||||||
wasmi = "0.7.0"
|
wasmi = "0.7.0"
|
||||||
|
|
||||||
|
|||||||
@@ -433,6 +433,7 @@ impl Config {
|
|||||||
cfg.wasm_bulk_memory(true)
|
cfg.wasm_bulk_memory(true)
|
||||||
.wasm_reference_types(true)
|
.wasm_reference_types(true)
|
||||||
.wasm_module_linking(self.module_config.config.module_linking_enabled)
|
.wasm_module_linking(self.module_config.config.module_linking_enabled)
|
||||||
|
.wasm_multi_value(self.module_config.config.multi_value_enabled)
|
||||||
.wasm_multi_memory(self.module_config.config.max_memories > 1)
|
.wasm_multi_memory(self.module_config.config.max_memories > 1)
|
||||||
.wasm_simd(self.module_config.config.simd_enabled)
|
.wasm_simd(self.module_config.config.simd_enabled)
|
||||||
.wasm_memory64(self.module_config.config.memory64_enabled)
|
.wasm_memory64(self.module_config.config.memory64_enabled)
|
||||||
@@ -648,10 +649,9 @@ impl<'a> Arbitrary<'a> for ModuleConfig {
|
|||||||
// Allow multi-table by default.
|
// Allow multi-table by default.
|
||||||
config.max_tables = config.max_tables.max(4);
|
config.max_tables = config.max_tables.max(4);
|
||||||
|
|
||||||
// Allow enabling some various wasm proposals by default.
|
// Allow enabling some various wasm proposals by default. Note that
|
||||||
config.bulk_memory_enabled = u.arbitrary()?;
|
// these are all unconditionally turned off even with
|
||||||
config.reference_types_enabled = u.arbitrary()?;
|
// `SwarmConfig::arbitrary`.
|
||||||
config.simd_enabled = u.arbitrary()?;
|
|
||||||
config.memory64_enabled = u.arbitrary()?;
|
config.memory64_enabled = u.arbitrary()?;
|
||||||
|
|
||||||
Ok(ModuleConfig { config })
|
Ok(ModuleConfig { config })
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ impl TableOps {
|
|||||||
val_type: wasm_encoder::ValType::ExternRef,
|
val_type: wasm_encoder::ValType::ExternRef,
|
||||||
mutable: true,
|
mutable: true,
|
||||||
},
|
},
|
||||||
Instruction::RefNull(wasm_encoder::ValType::ExternRef),
|
&Instruction::RefNull(wasm_encoder::ValType::ExternRef),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ impl TableOps {
|
|||||||
// implementations.
|
// implementations.
|
||||||
let mut func = Function::new(vec![(1, ValType::ExternRef)]);
|
let mut func = Function::new(vec![(1, ValType::ExternRef)]);
|
||||||
|
|
||||||
func.instruction(Instruction::Loop(wasm_encoder::BlockType::Empty));
|
func.instruction(&Instruction::Loop(wasm_encoder::BlockType::Empty));
|
||||||
for op in self.ops.iter().take(MAX_OPS) {
|
for op in self.ops.iter().take(MAX_OPS) {
|
||||||
op.insert(
|
op.insert(
|
||||||
&mut func,
|
&mut func,
|
||||||
@@ -139,9 +139,9 @@ impl TableOps {
|
|||||||
self.num_globals() as u32,
|
self.num_globals() as u32,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
func.instruction(Instruction::Br(0));
|
func.instruction(&Instruction::Br(0));
|
||||||
func.instruction(Instruction::End);
|
func.instruction(&Instruction::End);
|
||||||
func.instruction(Instruction::End);
|
func.instruction(&Instruction::End);
|
||||||
|
|
||||||
let mut code = CodeSection::new();
|
let mut code = CodeSection::new();
|
||||||
code.function(&func);
|
code.function(&func);
|
||||||
@@ -222,101 +222,101 @@ impl TableOp {
|
|||||||
|
|
||||||
match self {
|
match self {
|
||||||
Self::Gc => {
|
Self::Gc => {
|
||||||
func.instruction(Instruction::Call(gc_func_idx));
|
func.instruction(&Instruction::Call(gc_func_idx));
|
||||||
func.instruction(Instruction::Drop);
|
func.instruction(&Instruction::Drop);
|
||||||
func.instruction(Instruction::Drop);
|
func.instruction(&Instruction::Drop);
|
||||||
func.instruction(Instruction::Drop);
|
func.instruction(&Instruction::Drop);
|
||||||
}
|
}
|
||||||
Self::Get(x) => {
|
Self::Get(x) => {
|
||||||
func.instruction(Instruction::I32Const(x % table_mod));
|
func.instruction(&Instruction::I32Const(x % table_mod));
|
||||||
func.instruction(Instruction::TableGet { table: 0 });
|
func.instruction(&Instruction::TableGet { table: 0 });
|
||||||
func.instruction(Instruction::Drop);
|
func.instruction(&Instruction::Drop);
|
||||||
}
|
}
|
||||||
Self::SetFromParam(x, y) => {
|
Self::SetFromParam(x, y) => {
|
||||||
func.instruction(Instruction::I32Const(x % table_mod));
|
func.instruction(&Instruction::I32Const(x % table_mod));
|
||||||
func.instruction(Instruction::LocalGet(y % num_params));
|
func.instruction(&Instruction::LocalGet(y % num_params));
|
||||||
func.instruction(Instruction::TableSet { table: 0 });
|
func.instruction(&Instruction::TableSet { table: 0 });
|
||||||
}
|
}
|
||||||
Self::SetFromGet(x, y) => {
|
Self::SetFromGet(x, y) => {
|
||||||
func.instruction(Instruction::I32Const(x % table_mod));
|
func.instruction(&Instruction::I32Const(x % table_mod));
|
||||||
func.instruction(Instruction::I32Const(y % table_mod));
|
func.instruction(&Instruction::I32Const(y % table_mod));
|
||||||
func.instruction(Instruction::TableGet { table: 0 });
|
func.instruction(&Instruction::TableGet { table: 0 });
|
||||||
func.instruction(Instruction::TableSet { table: 0 });
|
func.instruction(&Instruction::TableSet { table: 0 });
|
||||||
}
|
}
|
||||||
Self::SetFromMake(x, y, z) => {
|
Self::SetFromMake(x, y, z) => {
|
||||||
func.instruction(Instruction::Call(make_refs_func_idx));
|
func.instruction(&Instruction::Call(make_refs_func_idx));
|
||||||
|
|
||||||
func.instruction(Instruction::LocalSet(num_params));
|
func.instruction(&Instruction::LocalSet(num_params));
|
||||||
func.instruction(Instruction::I32Const(x % table_mod));
|
func.instruction(&Instruction::I32Const(x % table_mod));
|
||||||
func.instruction(Instruction::LocalGet(num_params));
|
func.instruction(&Instruction::LocalGet(num_params));
|
||||||
func.instruction(Instruction::TableSet { table: 0 });
|
func.instruction(&Instruction::TableSet { table: 0 });
|
||||||
|
|
||||||
func.instruction(Instruction::LocalSet(num_params));
|
func.instruction(&Instruction::LocalSet(num_params));
|
||||||
func.instruction(Instruction::I32Const(y % table_mod));
|
func.instruction(&Instruction::I32Const(y % table_mod));
|
||||||
func.instruction(Instruction::LocalGet(num_params));
|
func.instruction(&Instruction::LocalGet(num_params));
|
||||||
func.instruction(Instruction::TableSet { table: 0 });
|
func.instruction(&Instruction::TableSet { table: 0 });
|
||||||
|
|
||||||
func.instruction(Instruction::LocalSet(num_params));
|
func.instruction(&Instruction::LocalSet(num_params));
|
||||||
func.instruction(Instruction::I32Const(z % table_mod));
|
func.instruction(&Instruction::I32Const(z % table_mod));
|
||||||
func.instruction(Instruction::LocalGet(num_params));
|
func.instruction(&Instruction::LocalGet(num_params));
|
||||||
func.instruction(Instruction::TableSet { table: 0 });
|
func.instruction(&Instruction::TableSet { table: 0 });
|
||||||
}
|
}
|
||||||
TableOp::Make => {
|
TableOp::Make => {
|
||||||
func.instruction(Instruction::Call(make_refs_func_idx));
|
func.instruction(&Instruction::Call(make_refs_func_idx));
|
||||||
func.instruction(Instruction::Drop);
|
func.instruction(&Instruction::Drop);
|
||||||
func.instruction(Instruction::Drop);
|
func.instruction(&Instruction::Drop);
|
||||||
func.instruction(Instruction::Drop);
|
func.instruction(&Instruction::Drop);
|
||||||
}
|
}
|
||||||
TableOp::TakeFromParams(x, y, z) => {
|
TableOp::TakeFromParams(x, y, z) => {
|
||||||
func.instruction(Instruction::LocalGet(x % num_params));
|
func.instruction(&Instruction::LocalGet(x % num_params));
|
||||||
func.instruction(Instruction::LocalGet(y % num_params));
|
func.instruction(&Instruction::LocalGet(y % num_params));
|
||||||
func.instruction(Instruction::LocalGet(z % num_params));
|
func.instruction(&Instruction::LocalGet(z % num_params));
|
||||||
func.instruction(Instruction::Call(take_refs_func_idx));
|
func.instruction(&Instruction::Call(take_refs_func_idx));
|
||||||
}
|
}
|
||||||
TableOp::TakeFromGet(x, y, z) => {
|
TableOp::TakeFromGet(x, y, z) => {
|
||||||
func.instruction(Instruction::I32Const(x % table_mod));
|
func.instruction(&Instruction::I32Const(x % table_mod));
|
||||||
func.instruction(Instruction::TableGet { table: 0 });
|
func.instruction(&Instruction::TableGet { table: 0 });
|
||||||
|
|
||||||
func.instruction(Instruction::I32Const(y % table_mod));
|
func.instruction(&Instruction::I32Const(y % table_mod));
|
||||||
func.instruction(Instruction::TableGet { table: 0 });
|
func.instruction(&Instruction::TableGet { table: 0 });
|
||||||
|
|
||||||
func.instruction(Instruction::I32Const(z % table_mod));
|
func.instruction(&Instruction::I32Const(z % table_mod));
|
||||||
func.instruction(Instruction::TableGet { table: 0 });
|
func.instruction(&Instruction::TableGet { table: 0 });
|
||||||
|
|
||||||
func.instruction(Instruction::Call(take_refs_func_idx));
|
func.instruction(&Instruction::Call(take_refs_func_idx));
|
||||||
}
|
}
|
||||||
TableOp::TakeFromMake => {
|
TableOp::TakeFromMake => {
|
||||||
func.instruction(Instruction::Call(make_refs_func_idx));
|
func.instruction(&Instruction::Call(make_refs_func_idx));
|
||||||
func.instruction(Instruction::Call(take_refs_func_idx));
|
func.instruction(&Instruction::Call(take_refs_func_idx));
|
||||||
}
|
}
|
||||||
Self::TakeFromGc => {
|
Self::TakeFromGc => {
|
||||||
func.instruction(Instruction::Call(gc_func_idx));
|
func.instruction(&Instruction::Call(gc_func_idx));
|
||||||
func.instruction(Instruction::Call(take_refs_func_idx));
|
func.instruction(&Instruction::Call(take_refs_func_idx));
|
||||||
}
|
}
|
||||||
TableOp::GetGlobal(x) => {
|
TableOp::GetGlobal(x) => {
|
||||||
func.instruction(Instruction::GlobalGet(x % num_globals));
|
func.instruction(&Instruction::GlobalGet(x % num_globals));
|
||||||
func.instruction(Instruction::Drop);
|
func.instruction(&Instruction::Drop);
|
||||||
}
|
}
|
||||||
TableOp::SetGlobalFromParam(global, param) => {
|
TableOp::SetGlobalFromParam(global, param) => {
|
||||||
func.instruction(Instruction::LocalGet(param % num_params));
|
func.instruction(&Instruction::LocalGet(param % num_params));
|
||||||
func.instruction(Instruction::GlobalSet(global % num_globals));
|
func.instruction(&Instruction::GlobalSet(global % num_globals));
|
||||||
}
|
}
|
||||||
TableOp::SetGlobalFromGet(global, x) => {
|
TableOp::SetGlobalFromGet(global, x) => {
|
||||||
func.instruction(Instruction::I32Const(x));
|
func.instruction(&Instruction::I32Const(x));
|
||||||
func.instruction(Instruction::TableGet { table: 0 });
|
func.instruction(&Instruction::TableGet { table: 0 });
|
||||||
func.instruction(Instruction::GlobalSet(global % num_globals));
|
func.instruction(&Instruction::GlobalSet(global % num_globals));
|
||||||
}
|
}
|
||||||
TableOp::SetGlobalFromMake(x, y, z) => {
|
TableOp::SetGlobalFromMake(x, y, z) => {
|
||||||
func.instruction(Instruction::Call(make_refs_func_idx));
|
func.instruction(&Instruction::Call(make_refs_func_idx));
|
||||||
func.instruction(Instruction::GlobalSet(x % num_globals));
|
func.instruction(&Instruction::GlobalSet(x % num_globals));
|
||||||
func.instruction(Instruction::GlobalSet(y % num_globals));
|
func.instruction(&Instruction::GlobalSet(y % num_globals));
|
||||||
func.instruction(Instruction::GlobalSet(z % num_globals));
|
func.instruction(&Instruction::GlobalSet(z % num_globals));
|
||||||
}
|
}
|
||||||
TableOp::TakeFromGlobalGet(x, y, z) => {
|
TableOp::TakeFromGlobalGet(x, y, z) => {
|
||||||
func.instruction(Instruction::GlobalGet(x % num_globals));
|
func.instruction(&Instruction::GlobalGet(x % num_globals));
|
||||||
func.instruction(Instruction::GlobalGet(y % num_globals));
|
func.instruction(&Instruction::GlobalGet(y % num_globals));
|
||||||
func.instruction(Instruction::GlobalGet(z % num_globals));
|
func.instruction(&Instruction::GlobalGet(z % num_globals));
|
||||||
func.instruction(Instruction::Call(take_refs_func_idx));
|
func.instruction(&Instruction::Call(take_refs_func_idx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user