From e8243db54a7bb1a8baee72dd42845c2092338c5b Mon Sep 17 00:00:00 2001 From: Brenton Farmer Date: Sun, 22 Sep 2024 12:58:51 -0700 Subject: [PATCH] fix try catch --- src/Hyperbee.AsyncExpressions/GotoTransformerVisitor.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Hyperbee.AsyncExpressions/GotoTransformerVisitor.cs b/src/Hyperbee.AsyncExpressions/GotoTransformerVisitor.cs index 29c8ad6..f1d75cd 100644 --- a/src/Hyperbee.AsyncExpressions/GotoTransformerVisitor.cs +++ b/src/Hyperbee.AsyncExpressions/GotoTransformerVisitor.cs @@ -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]; }