Skip to content

Commit

Permalink
Revert rename
Browse files Browse the repository at this point in the history
  • Loading branch information
shargon committed Nov 7, 2024
1 parent 30c1776 commit 8c83211
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Neo.VM/ExecutionEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class ExecutionEngine : IDisposable
/// <summary>
/// The VM object representing the uncaught exception.
/// </summary>
public StackItem? UncaughtVMCatchableException { get; internal set; }
public StackItem? UncaughtException { get; internal set; }

/// <summary>
/// The current state of the VM.
Expand Down
12 changes: 6 additions & 6 deletions src/Neo.VM/JumpTable/JumpTable.Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,10 @@ public virtual void EndFinally(ExecutionEngine engine, Instruction instruction)
if (!engine.CurrentContext.TryStack.TryPop(out var currentTry))
throw new InvalidOperationException($"The corresponding TRY block cannot be found.");

if (engine.UncaughtVMCatchableException is null)
if (engine.UncaughtException is null)
engine.CurrentContext.InstructionPointer = currentTry.EndPointer;
else
ExecuteThrow(engine, engine.UncaughtVMCatchableException);
ExecuteThrow(engine, engine.UncaughtException);

engine.isJumping = true;
}
Expand Down Expand Up @@ -659,7 +659,7 @@ public virtual void ExecuteTry(ExecutionEngine engine, int catchOffset, int fina
/// <param name="ex">The exception to throw.</param>
public virtual void ExecuteThrow(ExecutionEngine engine, StackItem? ex)
{
engine.UncaughtVMCatchableException = ex;
engine.UncaughtException = ex;

var pop = 0;
foreach (var executionContext in engine.InvocationStack)
Expand All @@ -680,9 +680,9 @@ public virtual void ExecuteThrow(ExecutionEngine engine, StackItem? ex)
if (tryContext.State == ExceptionHandlingState.Try && tryContext.HasCatch)
{
tryContext.State = ExceptionHandlingState.Catch;
engine.Push(engine.UncaughtVMCatchableException!);
engine.Push(engine.UncaughtException!);
executionContext.InstructionPointer = tryContext.CatchPointer;
engine.UncaughtVMCatchableException = null;
engine.UncaughtException = null;
}
else
{
Expand All @@ -696,7 +696,7 @@ public virtual void ExecuteThrow(ExecutionEngine engine, StackItem? ex)
++pop;
}

throw new VMUnhandledException(engine.UncaughtVMCatchableException!);
throw new VMUnhandledException(engine.UncaughtException!);
}

#endregion
Expand Down
6 changes: 3 additions & 3 deletions src/Neo/SmartContract/ApplicationEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ internal override void UnloadContext(ExecutionContext context)
if (context.Script != CurrentContext?.Script)
{
ExecutionContextState state = context.GetState<ExecutionContextState>();
if (UncaughtVMCatchableException is null)
if (UncaughtException is null)
{
state.SnapshotCache?.Commit();
if (CurrentContext != null)
Expand All @@ -380,8 +380,8 @@ internal override void UnloadContext(ExecutionContext context)
Diagnostic?.ContextUnloaded(context);
if (contractTasks.Remove(context, out var awaiter))
{
if (UncaughtVMCatchableException is not null)
throw new VMUnhandledException(UncaughtVMCatchableException);
if (UncaughtException is not null)
throw new VMUnhandledException(UncaughtException);
awaiter.SetResult(this);
}
}
Expand Down

0 comments on commit 8c83211

Please sign in to comment.