@@ -2278,7 +2278,11 @@ private Object bytecodeLoop(VirtualFrame virtualFrame, Frame localFrame, Bytecod
2278
2278
CompilerAsserts .partialEvaluationConstant (targetIndex );
2279
2279
chainPythonExceptions (virtualFrame , mutableData , pe );
2280
2280
if (targetIndex == -1 ) {
2281
- throw reraiseUnhandledException (virtualFrame , localFrame , initialStackTop , isGeneratorOrCoroutine , mutableData , bciSlot , beginBci , pe , tracingEnabled , profilingEnabled );
2281
+ reraiseUnhandledException (virtualFrame , localFrame , initialStackTop , isGeneratorOrCoroutine , mutableData , bciSlot , beginBci , pe , tracingEnabled , profilingEnabled );
2282
+ if (pe != null ) {
2283
+ throw pe ;
2284
+ }
2285
+ throw e ;
2282
2286
}
2283
2287
if (pe != null ) {
2284
2288
pe .setCatchingFrameReference (virtualFrame , this , beginBci );
@@ -3042,7 +3046,7 @@ private void unboxVariables(Frame localFrame) {
3042
3046
}
3043
3047
3044
3048
@ InliningCutoff
3045
- private PException reraiseUnhandledException (VirtualFrame virtualFrame , Frame localFrame , int initialStackTop , boolean isGeneratorOrCoroutine , MutableLoopData mutableData , int bciSlot ,
3049
+ private void reraiseUnhandledException (VirtualFrame virtualFrame , Frame localFrame , int initialStackTop , boolean isGeneratorOrCoroutine , MutableLoopData mutableData , int bciSlot ,
3046
3050
int beginBci , PException pe , boolean tracingEnabled , boolean profilingEnabled ) {
3047
3051
// For tracebacks
3048
3052
setCurrentBci (virtualFrame , bciSlot , beginBci );
@@ -3059,7 +3063,6 @@ private PException reraiseUnhandledException(VirtualFrame virtualFrame, Frame lo
3059
3063
LoopNode .reportLoopCount (this , mutableData .loopCount );
3060
3064
}
3061
3065
traceOrProfileReturn (virtualFrame , mutableData , PNone .NONE , tracingEnabled , profilingEnabled );
3062
- throw pe ;
3063
3066
}
3064
3067
3065
3068
@ InliningCutoff
0 commit comments