Add Return

This commit is contained in:
Jef
2018-12-19 16:39:20 +00:00
parent c52cf1493a
commit 9decdca525
2 changed files with 14 additions and 1 deletions

View File

@@ -169,6 +169,18 @@ pub fn translate(
ty,
));
}
Operator::Return => {
control_frames
.last_mut()
.expect("control stack is never empty")
.mark_unreachable();
let control_frame = control_frames.get(0).expect("control stack is never empty");
return_from_block(ctx, control_frame.arity(), true);
br(ctx, control_frame.kind.branch_target());
}
Operator::Br { relative_depth } => {
control_frames
.last_mut()