@@ -55,7 +55,7 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
5555    environ :  & mut  FE , 
5656)  -> WasmResult < ( ) >  { 
5757    if  !state. reachable  { 
58-         translate_unreachable_operator ( module_translation_state,  & op,  builder,  state) ?; 
58+         translate_unreachable_operator ( module_translation_state,  & op,  builder,  state,  environ ) ?; 
5959        return  Ok ( ( ) ) ; 
6060    } 
6161
@@ -139,13 +139,13 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
139139         ***********************************************************************************/ 
140140        Operator :: Block  {  ty }  => { 
141141            let  ( params,  results)  = blocktype_params_results ( module_translation_state,  * ty) ?; 
142-             let  next = ebb_with_params ( builder,  results) ?; 
142+             let  next = ebb_with_params ( builder,  results,  environ ) ?; 
143143            state. push_block ( next,  params. len ( ) ,  results. len ( ) ) ; 
144144        } 
145145        Operator :: Loop  {  ty }  => { 
146146            let  ( params,  results)  = blocktype_params_results ( module_translation_state,  * ty) ?; 
147-             let  loop_body = ebb_with_params ( builder,  params) ?; 
148-             let  next = ebb_with_params ( builder,  results) ?; 
147+             let  loop_body = ebb_with_params ( builder,  params,  environ ) ?; 
148+             let  next = ebb_with_params ( builder,  results,  environ ) ?; 
149149            builder. ins ( ) . jump ( loop_body,  state. peekn ( params. len ( ) ) ) ; 
150150            state. push_loop ( loop_body,  next,  params. len ( ) ,  results. len ( ) ) ; 
151151
@@ -168,16 +168,16 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
168168                // destination ebb following the whole `if...end`. If we do end 
169169                // up discovering an `else`, then we will allocate an ebb for it 
170170                // and go back and patch the jump. 
171-                 let  destination = ebb_with_params ( builder,  results) ?; 
171+                 let  destination = ebb_with_params ( builder,  results,  environ ) ?; 
172172                let  branch_inst = builder
173173                    . ins ( ) 
174174                    . brz ( val,  destination,  state. peekn ( params. len ( ) ) ) ; 
175175                ( destination,  ElseData :: NoElse  {  branch_inst } ) 
176176            }  else  { 
177177                // The `if` type signature is not valid without an `else` block, 
178178                // so we eagerly allocate the `else` block here. 
179-                 let  destination = ebb_with_params ( builder,  results) ?; 
180-                 let  else_block = ebb_with_params ( builder,  params) ?; 
179+                 let  destination = ebb_with_params ( builder,  results,  environ ) ?; 
180+                 let  else_block = ebb_with_params ( builder,  params,  environ ) ?; 
181181                builder
182182                    . ins ( ) 
183183                    . brz ( val,  else_block,  state. peekn ( params. len ( ) ) ) ; 
@@ -229,7 +229,7 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
229229                                let  ( params,  _results)  =
230230                                    blocktype_params_results ( module_translation_state,  blocktype) ?; 
231231                                debug_assert_eq ! ( params. len( ) ,  num_return_values) ; 
232-                                 let  else_ebb = ebb_with_params ( builder,  params) ?; 
232+                                 let  else_ebb = ebb_with_params ( builder,  params,  environ ) ?; 
233233                                builder. ins ( ) . jump ( destination,  state. peekn ( params. len ( ) ) ) ; 
234234                                state. popn ( params. len ( ) ) ; 
235235
@@ -1352,11 +1352,12 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
13521352/// Deals with a Wasm instruction located in an unreachable portion of the code. Most of them 
13531353/// are dropped but special ones like `End` or `Else` signal the potential end of the unreachable 
13541354/// portion so the translation state must be updated accordingly. 
1355- fn  translate_unreachable_operator ( 
1355+ fn  translate_unreachable_operator < FE :   FuncEnvironment  + ? Sized > ( 
13561356    module_translation_state :  & ModuleTranslationState , 
13571357    op :  & Operator , 
13581358    builder :  & mut  FunctionBuilder , 
13591359    state :  & mut  FuncTranslationState , 
1360+     environ :  & mut  FE , 
13601361)  -> WasmResult < ( ) >  { 
13611362    debug_assert ! ( !state. reachable) ; 
13621363    match  * op { 
@@ -1397,7 +1398,7 @@ fn translate_unreachable_operator(
13971398                            ElseData :: NoElse  {  branch_inst }  => { 
13981399                                let  ( params,  _results)  =
13991400                                    blocktype_params_results ( module_translation_state,  blocktype) ?; 
1400-                                 let  else_ebb = ebb_with_params ( builder,  params) ?; 
1401+                                 let  else_ebb = ebb_with_params ( builder,  params,  environ ) ?; 
14011402
14021403                                // We change the target of the branch instruction. 
14031404                                builder. change_jump_destination ( branch_inst,  else_ebb) ; 
0 commit comments