File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1911,8 +1911,18 @@ impl ExecutingFrame<'_> {
1911
1911
} ) ;
1912
1912
}
1913
1913
1914
+ #[ track_caller]
1914
1915
fn pop_block ( & mut self ) -> Block {
1915
1916
let block = self . state . blocks . pop ( ) . expect ( "No more blocks to pop!" ) ;
1917
+ #[ cfg( debug_assertions) ]
1918
+ if self . state . stack . len ( ) < block. level {
1919
+ dbg ! ( & self ) ;
1920
+ panic ! (
1921
+ "stack size reversion: current size({}) < truncates target({})." ,
1922
+ self . state. stack. len( ) ,
1923
+ block. level
1924
+ ) ;
1925
+ }
1916
1926
self . state . stack . truncate ( block. level ) ;
1917
1927
block
1918
1928
}
@@ -1945,7 +1955,7 @@ impl ExecutingFrame<'_> {
1945
1955
}
1946
1956
1947
1957
#[ inline]
1948
- #[ track_caller] // not a real track_caller but pop_value is not very useful
1958
+ #[ track_caller] // not a real track_caller but top_value is not very useful
1949
1959
fn top_value ( & self ) -> & PyObject {
1950
1960
match & * self . state . stack {
1951
1961
[ .., last] => last,
You can’t perform that action at this time.
0 commit comments