Use WasmError::Unsupported rather than panic for unsupported extensions.
This commit is contained in:
@@ -27,7 +27,7 @@ use cretonne_codegen::ir::types::*;
|
|||||||
use cretonne_codegen::ir::{self, InstBuilder, JumpTableData, MemFlags};
|
use cretonne_codegen::ir::{self, InstBuilder, JumpTableData, MemFlags};
|
||||||
use cretonne_codegen::packed_option::ReservedValue;
|
use cretonne_codegen::packed_option::ReservedValue;
|
||||||
use cretonne_frontend::{FunctionBuilder, Variable};
|
use cretonne_frontend::{FunctionBuilder, Variable};
|
||||||
use environ::{FuncEnvironment, GlobalValue, WasmResult};
|
use environ::{FuncEnvironment, GlobalValue, WasmError, WasmResult};
|
||||||
use state::{ControlStackFrame, TranslationState};
|
use state::{ControlStackFrame, TranslationState};
|
||||||
use std::collections::{hash_map, HashMap};
|
use std::collections::{hash_map, HashMap};
|
||||||
use std::vec::Vec;
|
use std::vec::Vec;
|
||||||
@@ -636,7 +636,9 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
|
|||||||
| Operator::I64TruncUSatF32
|
| Operator::I64TruncUSatF32
|
||||||
| Operator::I32TruncUSatF64
|
| Operator::I32TruncUSatF64
|
||||||
| Operator::I32TruncUSatF32 => {
|
| Operator::I32TruncUSatF32 => {
|
||||||
panic!("proposed saturating conversion operators not yet supported");
|
return Err(WasmError::Unsupported(
|
||||||
|
"proposed saturating conversion operators",
|
||||||
|
));
|
||||||
}
|
}
|
||||||
Operator::F32ReinterpretI32 => {
|
Operator::F32ReinterpretI32 => {
|
||||||
let val = state.pop1();
|
let val = state.pop1();
|
||||||
@@ -881,7 +883,7 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
|
|||||||
| Operator::I64AtomicRmw8UCmpxchg { .. }
|
| Operator::I64AtomicRmw8UCmpxchg { .. }
|
||||||
| Operator::I64AtomicRmw16UCmpxchg { .. }
|
| Operator::I64AtomicRmw16UCmpxchg { .. }
|
||||||
| Operator::I64AtomicRmw32UCmpxchg { .. } => {
|
| Operator::I64AtomicRmw32UCmpxchg { .. } => {
|
||||||
panic!("proposed thread operators not yet supported");
|
return Err(WasmError::Unsupported("proposed thread operators"));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user