mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-18 11:21:21 +00:00
replace panics by CodeGen Error in codegen_x64
This commit is contained in:
@ -3873,7 +3873,11 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
|
|||||||
returns: match ty {
|
returns: match ty {
|
||||||
WpTypeOrFuncType::Type(WpType::EmptyBlockType) => smallvec![],
|
WpTypeOrFuncType::Type(WpType::EmptyBlockType) => smallvec![],
|
||||||
WpTypeOrFuncType::Type(inner_ty) => smallvec![inner_ty],
|
WpTypeOrFuncType::Type(inner_ty) => smallvec![inner_ty],
|
||||||
_ => panic!("multi-value returns not yet implemented"),
|
_ => {
|
||||||
|
return Err(CodegenError {
|
||||||
|
message: "multi-value returns not yet implemented",
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
value_stack_depth: self.value_stack.len(),
|
value_stack_depth: self.value_stack.len(),
|
||||||
state: self.machine.state.clone(),
|
state: self.machine.state.clone(),
|
||||||
@ -3980,7 +3984,11 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
|
|||||||
returns: match ty {
|
returns: match ty {
|
||||||
WpTypeOrFuncType::Type(WpType::EmptyBlockType) => smallvec![],
|
WpTypeOrFuncType::Type(WpType::EmptyBlockType) => smallvec![],
|
||||||
WpTypeOrFuncType::Type(inner_ty) => smallvec![inner_ty],
|
WpTypeOrFuncType::Type(inner_ty) => smallvec![inner_ty],
|
||||||
_ => panic!("multi-value returns not yet implemented"),
|
_ => {
|
||||||
|
return Err(CodegenError {
|
||||||
|
message: "multi-value returns not yet implemented",
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
value_stack_depth: self.value_stack.len(),
|
value_stack_depth: self.value_stack.len(),
|
||||||
state: self.machine.state.clone(),
|
state: self.machine.state.clone(),
|
||||||
@ -4005,7 +4013,11 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
|
|||||||
returns: match ty {
|
returns: match ty {
|
||||||
WpTypeOrFuncType::Type(WpType::EmptyBlockType) => smallvec![],
|
WpTypeOrFuncType::Type(WpType::EmptyBlockType) => smallvec![],
|
||||||
WpTypeOrFuncType::Type(inner_ty) => smallvec![inner_ty],
|
WpTypeOrFuncType::Type(inner_ty) => smallvec![inner_ty],
|
||||||
_ => panic!("multi-value returns not yet implemented"),
|
_ => {
|
||||||
|
return Err(CodegenError {
|
||||||
|
message: "multi-value returns not yet implemented",
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
value_stack_depth: self.value_stack.len(),
|
value_stack_depth: self.value_stack.len(),
|
||||||
state: self.machine.state.clone(),
|
state: self.machine.state.clone(),
|
||||||
@ -4966,7 +4978,10 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
panic!("not yet implemented: {:?}", op);
|
return Err(CodegenError {
|
||||||
|
message: "not yet implemented: {:?}",
|
||||||
|
op,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user