File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
crates/wasmi/src/engine/translator/func2 Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -250,6 +250,9 @@ impl FuncTranslator {
250
250
251
251
/// Translates the end of the Wasm function enclosing Wasm `block`.
252
252
fn translate_end_func ( & mut self , frame : BlockControlFrame ) -> Result < ( ) , Error > {
253
+ if !self . reachable {
254
+ return Ok ( ( ) ) ;
255
+ }
253
256
let _fuel_info = match ( & self . fuel_costs , frame. consume_fuel_instr ( ) ) {
254
257
( Some ( fuel_costs) , Some ( consume_fuel) ) => {
255
258
FuelInfo :: some ( fuel_costs. clone ( ) , consume_fuel)
@@ -258,7 +261,7 @@ impl FuncTranslator {
258
261
_ => unreachable ! ( ) ,
259
262
} ;
260
263
let len_results = frame. ty ( ) . len_results ( & self . engine ) ;
261
- if self . reachable && frame. is_branched_to ( ) && len_results > 1 {
264
+ if frame. is_branched_to ( ) && len_results > 1 {
262
265
let height = frame. height ( ) ;
263
266
let len_results = usize:: from ( len_results) ;
264
267
for depth in 0 ..len_results {
You can’t perform that action at this time.
0 commit comments