MCPcopy Index your code
hub / github.com/RustPython/RustPython / for_iter_jump_target

Method for_iter_jump_target

crates/vm/src/frame.rs:6965–6976  ·  view source on GitHub ↗

Compute the jump target for FOR_ITER exhaustion: skip END_FOR and jump to POP_ITER.

(&self, target: bytecode::Label)

Source from the content-addressed store, hash-verified

6963
6964 /// Compute the jump target for FOR_ITER exhaustion: skip END_FOR and jump to POP_ITER.
6965 fn for_iter_jump_target(&self, target: bytecode::Label) -> bytecode::Label {
6966 let target_idx = target.as_usize();
6967 if let Some(unit) = self.code.instructions.get(target_idx)
6968 && matches!(
6969 unit.op,
6970 bytecode::Instruction::EndFor | bytecode::Instruction::InstrumentedEndFor
6971 )
6972 {
6973 return bytecode::Label::from_u32(target.as_u32() + 1);
6974 }
6975 target
6976 }
6977 fn execute_make_function(&mut self, vm: &VirtualMachine) -> FrameResult {
6978 // MakeFunction only takes code object, no flags
6979 let code_obj: PyRef<PyCode> = self

Callers 1

execute_for_iterMethod · 0.80

Calls 2

as_u32Method · 0.80
getMethod · 0.45

Tested by

no test coverage detected