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

Function explain_incompatible_stack

crates/vm/src/builtins/frame.rs:136–150  ·  view source on GitHub ↗
(to_stack: i64)

Source from the content-addressed store, hash-verified

134 }
135
136 pub fn explain_incompatible_stack(to_stack: i64) -> &'static str {
137 debug_assert!(to_stack != 0);
138 if to_stack == OVERFLOWED {
139 return "stack is too deep to analyze";
140 }
141 if to_stack == UNINITIALIZED {
142 return "can't jump into an exception handler, or code may be unreachable";
143 }
144 match Kind::from_i64(top_of_stack(to_stack)) {
145 Some(Kind::Except) => "can't jump into an 'except' block as there's no exception",
146 Some(Kind::Lasti) => "can't jump into a re-raising block as there's no location",
147 Some(Kind::Iterator) => "can't jump into the body of a for loop",
148 _ => "incompatible stacks",
149 }
150 }
151
152 /// Analyze bytecode and compute the stack state at each instruction index.
153 pub fn mark_stacks<C: Constant>(code: &bytecode::CodeObject<C>) -> Vec<i64> {

Callers 1

set_f_linenoMethod · 0.85

Calls 1

top_of_stackFunction · 0.85

Tested by

no test coverage detected