File tree Expand file tree Collapse file tree
crates/cairo-lang-runner/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -286,10 +286,9 @@ impl SierraCasmRunner {
286286 // The execution from the header created by self.builder.create_entry_code().
287287 // We expect the last trace entry to be the `ret` instruction at the end of the header.
288288 let header_end = relocated_trace. last ( ) . unwrap ( ) . pc ;
289+ used_resources. n_steps -= relocated_trace. iter ( ) . position ( |e| e. pc > header_end) . unwrap ( ) ;
289290 used_resources. n_steps -=
290- relocated_trace. iter ( ) . position ( |e| e. pc > header_end) . unwrap ( ) - 1 ;
291- used_resources. n_steps -=
292- relocated_trace. iter ( ) . rev ( ) . position ( |e| e. pc > header_end) . unwrap ( ) - 1 ;
291+ relocated_trace. iter ( ) . rev ( ) . position ( |e| e. pc > header_end) . unwrap ( ) ;
293292
294293 let ( results_data, gas_counter) = self . get_results_data ( & return_types, & memory, ap) ;
295294 assert ! ( results_data. len( ) <= 1 ) ;
You can’t perform that action at this time.
0 commit comments