@@ -752,7 +752,7 @@ impl Frame {
752
752
_ => vm. get_none ( ) ,
753
753
} ;
754
754
let exception = match argc {
755
- 0 => match vm. pop_exception ( ) {
755
+ 0 => match vm. current_exception ( ) {
756
756
Some ( exc) => exc,
757
757
None => {
758
758
return Err ( vm. new_exception (
@@ -767,7 +767,7 @@ impl Frame {
767
767
} ;
768
768
let context = match argc {
769
769
0 => vm. get_none ( ) , // We have already got the exception,
770
- _ => match vm. pop_exception ( ) {
770
+ _ => match vm. current_exception ( ) {
771
771
Some ( exc) => exc,
772
772
None => vm. get_none ( ) ,
773
773
} ,
@@ -891,7 +891,7 @@ impl Frame {
891
891
bytecode:: Instruction :: PopException { } => {
892
892
let block = self . pop_block ( ) . unwrap ( ) ; // this asserts that the block is_some.
893
893
if let BlockType :: ExceptHandler = block. typ {
894
- assert ! ( vm. pop_exception( ) . is_some ( ) ) ;
894
+ vm. pop_exception ( ) . expect ( "Should have exception in stack" ) ;
895
895
Ok ( None )
896
896
} else {
897
897
panic ! ( "Block type must be ExceptHandler here." )
@@ -983,7 +983,7 @@ impl Frame {
983
983
}
984
984
}
985
985
BlockType :: ExceptHandler => {
986
- vm. pop_exception ( ) ;
986
+ vm. pop_exception ( ) . expect ( "Should have exception in stack" ) ;
987
987
}
988
988
}
989
989
}
@@ -1009,7 +1009,7 @@ impl Frame {
1009
1009
}
1010
1010
} ,
1011
1011
BlockType :: ExceptHandler => {
1012
- vm. pop_exception ( ) ;
1012
+ vm. pop_exception ( ) . expect ( "Should have exception in stack" ) ;
1013
1013
}
1014
1014
}
1015
1015
@@ -1057,8 +1057,9 @@ impl Frame {
1057
1057
}
1058
1058
}
1059
1059
BlockType :: Loop { .. } => { }
1060
- // Exception was already popped on Raised.
1061
- BlockType :: ExceptHandler => { }
1060
+ BlockType :: ExceptHandler => {
1061
+ vm. pop_exception ( ) . expect ( "Should have exception in stack" ) ;
1062
+ }
1062
1063
}
1063
1064
}
1064
1065
Some ( exc)
0 commit comments