@@ -253,13 +253,7 @@ impl FuncTranslator {
253
253
if !self . reachable {
254
254
return Ok ( ( ) ) ;
255
255
}
256
- let _fuel_info = match ( & self . fuel_costs , frame. consume_fuel_instr ( ) ) {
257
- ( Some ( fuel_costs) , Some ( consume_fuel) ) => {
258
- FuelInfo :: some ( fuel_costs. clone ( ) , consume_fuel)
259
- }
260
- ( None , None ) => FuelInfo :: None ,
261
- _ => unreachable ! ( ) ,
262
- } ;
256
+ // let _fuel_info = self.fuel_info();
263
257
let len_results = frame. ty ( ) . len_results ( & self . engine ) ;
264
258
if frame. is_branched_to ( ) && len_results > 1 {
265
259
let height = frame. height ( ) ;
@@ -309,13 +303,8 @@ impl FuncTranslator {
309
303
}
310
304
}
311
305
}
312
- self . labels
313
- . pin_label ( frame. label ( ) , self . instrs . next_instr ( ) )
314
- . unwrap_or_else ( |err| panic ! ( "failed to pin label: {err}" ) ) ;
315
- match len_results {
316
- 0 => {
317
- self . instrs . push_instr ( Instruction :: Return ) ;
318
- }
306
+ let return_instr = match len_results {
307
+ 0 => self . instrs . push_instr ( Instruction :: Return ) ,
319
308
1 => {
320
309
let instr = match self . stack . peek ( 0 ) {
321
310
Operand :: Local ( operand) => {
@@ -352,15 +341,18 @@ impl FuncTranslator {
352
341
}
353
342
}
354
343
} ;
355
- self . instrs . push_instr ( instr) ;
344
+ self . instrs . push_instr ( instr)
356
345
}
357
346
_ => {
358
347
let height = frame. height ( ) ;
359
348
let result = self . layout . temp_to_reg ( OperandIdx :: from ( height - 1 ) ) ?;
360
349
let values = BoundedRegSpan :: new ( RegSpan :: new ( result) , len_results) ;
361
- self . instrs . push_instr ( Instruction :: return_span ( values) ) ;
350
+ self . instrs . push_instr ( Instruction :: return_span ( values) )
362
351
}
363
- }
352
+ } ;
353
+ self . labels
354
+ . pin_label ( frame. label ( ) , return_instr)
355
+ . unwrap_or_else ( |err| panic ! ( "failed to pin label: {err}" ) ) ;
364
356
Ok ( ( ) )
365
357
}
366
358
0 commit comments