Skip to content

Commit

Permalink
Revert fix
Browse files Browse the repository at this point in the history
  • Loading branch information
slozier committed Nov 27, 2024
1 parent ce7ce74 commit ccc60e5
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Src/Microsoft.Dynamic/Debugging/DebugInfoRewriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace Microsoft.Scripting.Debugging {
using Ast = MSAst.Expression;
using System.Threading;

/// <summary>
/// Used to rewrite expressions containing DebugInfoExpressions.
/// </summary>
Expand Down Expand Up @@ -355,12 +355,17 @@ protected override MSAst.Expression VisitDebugInfo(MSAst.DebugInfoExpression nod
// Update the location cookie
int locationCookie = _locationCookie++;
if (!_transformToGenerator) {
var tracebackCall = Ast.Call(
typeof(RuntimeOps).GetMethod(nameof(RuntimeOps.OnTraceEvent)),
_thread,
AstUtils.Constant(locationCookie),
Ast.Convert(Ast.Constant(null), typeof(Exception))
);
MSAst.Expression tracebackCall = null;
if (locationCookie == 0) {
tracebackCall = Ast.Empty();
} else {
tracebackCall = Ast.Call(
typeof(RuntimeOps).GetMethod(nameof(RuntimeOps.OnTraceEvent)),
_thread,
AstUtils.Constant(locationCookie),
Ast.Convert(Ast.Constant(null), typeof(Exception))
);
}

transformedExpression = Ast.Block(
Ast.Assign(
Expand Down

0 comments on commit ccc60e5

Please sign in to comment.