File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
crates/wasmi/src/engine/translator/func2 Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,14 @@ impl FuncTranslator {
237
237
238
238
/// Translates the end of a Wasm `block` control frame.
239
239
fn translate_end_block ( & mut self , frame : BlockControlFrame ) -> Result < ( ) , Error > {
240
+ if self . stack . is_control_empty ( ) {
241
+ return self . translate_end_func ( frame) ;
242
+ }
243
+ todo ! ( )
244
+ }
245
+
246
+ /// Translates the end of the Wasm function enclosing Wasm `block`.
247
+ fn translate_end_func ( & mut self , frame : BlockControlFrame ) -> Result < ( ) , Error > {
240
248
todo ! ( )
241
249
}
242
250
Original file line number Diff line number Diff line change @@ -99,6 +99,11 @@ impl Stack {
99
99
self . operands . register_locals ( amount, ty)
100
100
}
101
101
102
+ /// Returns `true` if the control stack is empty.
103
+ pub fn is_control_empty ( & self ) -> bool {
104
+ self . controls . is_empty ( )
105
+ }
106
+
102
107
/// Returns the current height of the [`Stack`].
103
108
///
104
109
/// # Note
You can’t perform that action at this time.
0 commit comments