[fuzz] Fix order of operands passed in to wasm-spec-interpreter (#4672)

In #4671, the meta-differential fuzz target was finding errors when
running certain Wasm modules (specifically `shr_s` in that case).
@conrad-watt diagnosed the issue as a missing reversal in the operands
passed to the spec interpreter. This change fixes #4671 and adds an
additional unit test to keep it fixed.
This commit is contained in:
Andrew Brown
2022-08-10 07:55:33 -07:00
committed by GitHub
parent 63c2d1e0c3
commit 7fa89c4a4f
3 changed files with 21 additions and 1 deletions

View File

@@ -119,4 +119,15 @@ mod tests {
])]
);
}
// See issue https://github.com/bytecodealliance/wasmtime/issues/4671.
#[test]
fn order_of_params() {
let module = wat::parse_file("tests/shr_s.wat").unwrap();
let parameters = Some(vec![Value::I32(1795123818), Value::I32(-2147483648)]);
let results = interpret(&module, parameters.clone()).unwrap();
assert_eq!(results, vec![Value::I32(1795123818)]);
}
}