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

Function pop_to_level

crates/vm/src/builtins/frame.rs:90–100  ·  view source on GitHub ↗
(mut stack: i64, level: u32)

Source from the content-addressed store, hash-verified

88 }
89
90 fn pop_to_level(mut stack: i64, level: u32) -> i64 {
91 if level == 0 {
92 return EMPTY_STACK;
93 }
94 let max_item: i64 = (1 << BITS_PER_BLOCK) - 1;
95 let level_max_stack = max_item << ((level - 1) * BITS_PER_BLOCK);
96 while stack > level_max_stack {
97 stack = pop_value(stack);
98 }
99 stack
100 }
101
102 fn compatible_kind(from: i64, to: i64) -> bool {
103 if to == 0 {

Callers 1

mark_stacksFunction · 0.85

Calls 1

pop_valueFunction · 0.85

Tested by

no test coverage detected