Test denial of floating-point parameters
This commit is contained in:
parent
cfc7f1b693
commit
bd7a13138f
13
src/lib.rs
13
src/lib.rs
|
@ -472,6 +472,19 @@ impl Module {
|
|||
///
|
||||
/// let module = wasmi::Module::from_buffer(&wasm_binary).expect("Parsing failed");
|
||||
/// assert!(module.deny_floating_point().is_err());
|
||||
///
|
||||
/// let wasm_binary: Vec<u8> =
|
||||
/// wabt::wat2wasm(
|
||||
/// r#"
|
||||
/// (module
|
||||
/// (func $add (param $lhs f32) (param $rhs f32) (result f32)
|
||||
/// get_local $lhs))
|
||||
/// "#,
|
||||
/// )
|
||||
/// .expect("failed to parse wat");
|
||||
///
|
||||
/// let module = wasmi::Module::from_buffer(&wasm_binary).expect("Parsing failed");
|
||||
/// assert!(module.deny_floating_point().is_err());
|
||||
/// ```
|
||||
pub fn deny_floating_point(&self) -> Result<(), Error> {
|
||||
validation::deny_floating_point(&self.module).map_err(Into::into)
|
||||
|
|
Loading…
Reference in New Issue