File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -885,7 +885,7 @@ protected override void VisitTryExceptNode(TryExceptNode node)
885885 var endIndex = AddLineNumber ( node . EndLocation . LineNumber ,
886886 CodeGenerationFlags . CodeStatistics | CodeGenerationFlags . DebugCode ) ;
887887
888- AddCommand ( OperationCode . EndTry ) ;
888+ AddCommand ( OperationCode . EndTry , beginHandler ) ;
889889 CorrectCommandArgument ( jmpIndex , endIndex ) ;
890890 }
891891
Original file line number Diff line number Diff line change @@ -1227,8 +1227,12 @@ private void BeginTry(int exceptBlockAddress)
12271227
12281228 private void EndTry ( int arg )
12291229 {
1230- if ( _exceptionsStack . Count > 0 && _exceptionsStack . Peek ( ) . HandlerFrame == _currentFrame )
1231- _exceptionsStack . Pop ( ) ;
1230+ if ( _exceptionsStack . Count > 0 )
1231+ {
1232+ var jmpInfo = _exceptionsStack . Peek ( ) ;
1233+ if ( jmpInfo . HandlerFrame == _currentFrame && arg == jmpInfo . HandlerAddress )
1234+ _exceptionsStack . Pop ( ) ;
1235+ }
12321236 _currentFrame . LastException = null ;
12331237 NextInstruction ( ) ;
12341238 }
You can’t perform that action at this time.
0 commit comments