@@ -198,7 +198,13 @@ fn run_code<EP: EnvProxy>(state: &mut State<EP>, call_stack: &mut Vec<Frame>) ->
198198 let instruction = {
199199 let frame = call_stack. last_mut ( ) . unwrap ( ) ;
200200 let instruction = py_unwrap ! ( state, frame. instructions. get( frame. program_counter) , ProcessorError :: InvalidProgramCounter ) ;
201- //println!("{} {:?}", frame.program_counter, instruction); // Useful for debugging
201+ // Useful for debugging:
202+ /*println!("");
203+ for r in frame.var_stack.iter() {
204+ println!("{}", r.repr(&state.store));
205+ }
206+ println!("{} {:?}", frame.program_counter, instruction);
207+ */
202208 frame. program_counter += 1 ;
203209 instruction. clone ( )
204210 } ;
@@ -414,6 +420,11 @@ fn run_code<EP: EnvProxy>(state: &mut State<EP>, call_stack: &mut Vec<Frame>) ->
414420 let obj_ref = py_unwrap ! ( state, frame. locals. borrow( ) . get( & name) , ProcessorError :: InvalidName ( name) ) . clone ( ) ;
415421 frame. var_stack . push ( obj_ref)
416422 }
423+ Instruction :: StoreFast ( i) => {
424+ let frame = call_stack. last_mut ( ) . unwrap ( ) ;
425+ let name = py_unwrap ! ( state, frame. code. varnames. get( i) , ProcessorError :: InvalidVarnameIndex ) . clone ( ) ;
426+ frame. locals . borrow_mut ( ) . insert ( name, pop_stack ! ( state, frame. var_stack) ) ;
427+ }
417428 Instruction :: PopJumpIfFalse ( target) => {
418429 let frame = call_stack. last_mut ( ) . unwrap ( ) ;
419430 let obj = state. store . deref ( & pop_stack ! ( state, frame. var_stack) ) ;
0 commit comments