wasm_conversions

This commit is contained in:
Svyatoslav Nikolsky 2017-06-19 13:24:57 +03:00
parent e56c334391
commit 328e08358d
2 changed files with 6 additions and 2 deletions

View File

@ -26,7 +26,9 @@ run_test!("break-drop", wasm_break_drop);
run_test!("call_indirect", wasm_call_indirect);
run_test!("call", wasm_call);
run_test!("comments", wasm_comments);
// TODO: run_test!("conversions", wasm_conversions);
// TODO: commented out until sNaN issue is resolved:
// https://github.com/NikVolf/parity-wasm/blob/b5aaf103cf28f1e36df832f4883f55043e67894b/src/interpreter/value.rs#L510
// run_test!("conversions", wasm_conversions);
// TODO: run_test!("custom_section", wasm_custom_section);
run_test!("endianness", wasm_endianness);
run_test!("f32_exports", wasm_exports);

View File

@ -274,7 +274,9 @@ macro_rules! impl_try_truncate_into {
return Err(Error::Value("invalid float value for this operation".into()));
}
if self < $into::MIN as $from || self > $into::MAX as $from {
// range check
let result = self as $into;
if result as $from != self.trunc() {
return Err(Error::Value("invalid float value for this operation".into()));
}