return_type isn't failable
This commit is contained in:
parent
716e8b5613
commit
cf0dee5c18
|
@ -358,7 +358,7 @@ impl FunctionReader {
|
||||||
// an explicit return.
|
// an explicit return.
|
||||||
|
|
||||||
// Check the return type.
|
// Check the return type.
|
||||||
if let BlockType::Value(value_type) = context.return_type()? {
|
if let BlockType::Value(value_type) = context.return_type() {
|
||||||
tee_value(
|
tee_value(
|
||||||
&mut context.value_stack,
|
&mut context.value_stack,
|
||||||
&context.frame_stack,
|
&context.frame_stack,
|
||||||
|
@ -413,7 +413,7 @@ impl FunctionReader {
|
||||||
return Ok(Outcome::Unreachable);
|
return Ok(Outcome::Unreachable);
|
||||||
}
|
}
|
||||||
Return => {
|
Return => {
|
||||||
if let BlockType::Value(value_type) = context.return_type()? {
|
if let BlockType::Value(value_type) = context.return_type() {
|
||||||
tee_value(
|
tee_value(
|
||||||
&mut context.value_stack,
|
&mut context.value_stack,
|
||||||
&context.frame_stack,
|
&context.frame_stack,
|
||||||
|
@ -1582,8 +1582,8 @@ impl<'a> FunctionValidationContext<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn return_type(&self) -> Result<BlockType, Error> {
|
fn return_type(&self) -> BlockType {
|
||||||
Ok(self.return_type)
|
self.return_type
|
||||||
}
|
}
|
||||||
|
|
||||||
fn into_code(self) -> isa::Instructions {
|
fn into_code(self) -> isa::Instructions {
|
||||||
|
|
Loading…
Reference in New Issue