return_type isn't failable

This commit is contained in:
Sergey Pepyakin 2019-04-01 17:20:26 +02:00
parent 716e8b5613
commit cf0dee5c18
1 changed files with 4 additions and 4 deletions

View File

@ -358,7 +358,7 @@ impl FunctionReader {
// an explicit return.
// Check the return type.
if let BlockType::Value(value_type) = context.return_type()? {
if let BlockType::Value(value_type) = context.return_type() {
tee_value(
&mut context.value_stack,
&context.frame_stack,
@ -413,7 +413,7 @@ impl FunctionReader {
return Ok(Outcome::Unreachable);
}
Return => {
if let BlockType::Value(value_type) = context.return_type()? {
if let BlockType::Value(value_type) = context.return_type() {
tee_value(
&mut context.value_stack,
&context.frame_stack,
@ -1582,8 +1582,8 @@ impl<'a> FunctionValidationContext<'a> {
}
}
fn return_type(&self) -> Result<BlockType, Error> {
Ok(self.return_type)
fn return_type(&self) -> BlockType {
self.return_type
}
fn into_code(self) -> isa::Instructions {