@@ -88,16 +88,16 @@ impl<'store> Executor<'store> {
8888 CallIndirect ( ty, table) => return self . exec_call_indirect :: < false > ( * ty, * table) ,
8989 ReturnCall ( v) => return self . exec_call_direct :: < true > ( * v) ,
9090 ReturnCallIndirect ( ty, table) => return self . exec_call_indirect :: < true > ( * ty, * table) ,
91- If ( end, el) => self . exec_if ( * end, * el, ( StackHeight :: default ( ) , StackHeight :: default ( ) ) ) . to_cf ( ) ? ,
92- IfWithType ( ty, end, el) => self . exec_if ( * end, * el, ( StackHeight :: default ( ) , ( * ty) . into ( ) ) ) . to_cf ( ) ? ,
93- IfWithFuncType ( ty, end, el) => self . exec_if ( * end, * el, self . resolve_functype ( * ty) ) . to_cf ( ) ? ,
91+ If ( end, el) => self . exec_if ( * end, * el, ( StackHeight :: default ( ) , StackHeight :: default ( ) ) ) ,
92+ IfWithType ( ty, end, el) => self . exec_if ( * end, * el, ( StackHeight :: default ( ) , ( * ty) . into ( ) ) ) ,
93+ IfWithFuncType ( ty, end, el) => self . exec_if ( * end, * el, self . resolve_functype ( * ty) ) ,
9494 Else ( end_offset) => self . exec_else ( * end_offset) ,
95- Loop ( end) => self . enter_block ( * end, BlockType :: Loop , ( StackHeight :: default ( ) , StackHeight :: default ( ) ) ) . to_cf ( ) ? ,
96- LoopWithType ( ty, end) => self . enter_block ( * end, BlockType :: Loop , ( StackHeight :: default ( ) , ( * ty) . into ( ) ) ) . to_cf ( ) ? ,
97- LoopWithFuncType ( ty, end) => self . enter_block ( * end, BlockType :: Loop , self . resolve_functype ( * ty) ) . to_cf ( ) ? ,
98- Block ( end) => self . enter_block ( * end, BlockType :: Block , ( StackHeight :: default ( ) , StackHeight :: default ( ) ) ) . to_cf ( ) ? ,
99- BlockWithType ( ty, end) => self . enter_block ( * end, BlockType :: Block , ( StackHeight :: default ( ) , ( * ty) . into ( ) ) ) . to_cf ( ) ? ,
100- BlockWithFuncType ( ty, end) => self . enter_block ( * end, BlockType :: Block , self . resolve_functype ( * ty) ) . to_cf ( ) ? ,
95+ Loop ( end) => self . enter_block ( * end, BlockType :: Loop , ( StackHeight :: default ( ) , StackHeight :: default ( ) ) ) ,
96+ LoopWithType ( ty, end) => self . enter_block ( * end, BlockType :: Loop , ( StackHeight :: default ( ) , ( * ty) . into ( ) ) ) ,
97+ LoopWithFuncType ( ty, end) => self . enter_block ( * end, BlockType :: Loop , self . resolve_functype ( * ty) ) ,
98+ Block ( end) => self . enter_block ( * end, BlockType :: Block , ( StackHeight :: default ( ) , StackHeight :: default ( ) ) ) ,
99+ BlockWithType ( ty, end) => self . enter_block ( * end, BlockType :: Block , ( StackHeight :: default ( ) , ( * ty) . into ( ) ) ) ,
100+ BlockWithFuncType ( ty, end) => self . enter_block ( * end, BlockType :: Block , self . resolve_functype ( * ty) ) ,
101101 Br ( v) => return self . exec_br ( * v) ,
102102 BrIf ( v) => return self . exec_br_if ( * v) ,
103103 BrTable ( default, len) => return self . exec_brtable ( * default, * len) ,
@@ -635,26 +635,21 @@ impl<'store> Executor<'store> {
635635 }
636636 }
637637
638- fn exec_if (
639- & mut self ,
640- else_offset : u32 ,
641- end_offset : u32 ,
642- ( params, results) : ( StackHeight , StackHeight ) ,
643- ) -> Result < ( ) > {
638+ fn exec_if ( & mut self , else_offset : u32 , end_offset : u32 , ( params, results) : ( StackHeight , StackHeight ) ) {
644639 // truthy value is on the top of the stack, so enter the then block
645640 if self . store . stack . values . pop :: < i32 > ( ) != 0 {
646- self . enter_block ( end_offset, BlockType :: If , ( params, results) ) ? ;
647- return Ok ( ( ) ) ;
641+ self . enter_block ( end_offset, BlockType :: If , ( params, results) ) ;
642+ return ;
648643 }
649644
650645 // falsy value is on the top of the stack
651646 if else_offset == 0 {
652647 self . cf . jump ( end_offset) ;
653- return Ok ( ( ) ) ;
648+ return ;
654649 }
655650
656651 self . cf . jump ( else_offset) ;
657- self . enter_block ( end_offset - else_offset, BlockType :: Else , ( params, results) )
652+ self . enter_block ( end_offset - else_offset, BlockType :: Else , ( params, results) ) ;
658653 }
659654 fn exec_else ( & mut self , end_offset : u32 ) {
660655 self . exec_end_block ( ) ;
@@ -664,12 +659,7 @@ impl<'store> Executor<'store> {
664659 let ty = self . module . func_ty ( idx) ;
665660 ( ( & * ty. params ) . into ( ) , ( & * ty. results ) . into ( ) )
666661 }
667- fn enter_block (
668- & mut self ,
669- end_instr_offset : u32 ,
670- ty : BlockType ,
671- ( params, results) : ( StackHeight , StackHeight ) ,
672- ) -> Result < ( ) > {
662+ fn enter_block ( & mut self , end_instr_offset : u32 , ty : BlockType , ( params, results) : ( StackHeight , StackHeight ) ) {
673663 self . store . stack . blocks . push ( BlockFrame {
674664 instr_ptr : self . cf . instr_ptr ( ) as u32 ,
675665 end_instr_offset,
0 commit comments