Skip to content

Commit

Permalink
fix try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
bfarmer67 committed Sep 22, 2024
1 parent 98cd592 commit e8243db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Hyperbee.AsyncExpressions/GotoTransformerVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,18 @@ protected override Expression VisitTry( TryExpression node ) //BF awaits aren't
var continueToIndex = InsertState();
PushContinueTo( continueToIndex );

var tryIndex = InsertState( node.Body );
var tryIndex = InsertState( node.Body, continueToIndex );
tryCatchTransition.TryNode = _states[tryIndex];

foreach ( var catchBlock in node.Handlers )
{
var catchIndex = InsertState( catchBlock.Body );
var catchIndex = InsertState( catchBlock.Body, continueToIndex );
tryCatchTransition.CatchNodes.Add( _states[catchIndex] );
}

if ( node.Finally != null )
{
var finallyIndex = InsertState( node.Finally );
var finallyIndex = InsertState( node.Finally, continueToIndex );
tryCatchTransition.FinallyNode = _states[finallyIndex];
}

Expand Down

0 comments on commit e8243db

Please sign in to comment.