Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Run()

override int System.Linq.Expressions.Interpreter.EnterTryCatchFinallyInstruction.Run ( InterpretedFrame frame)
inline

Definition at line 56 of file EnterTryCatchFinallyInstruction.cs.

57 {
58 if (_hasFinally)
59 {
60 frame.PushContinuation(_labelIndex);
61 }
62 int instructionIndex = frame.InstructionIndex;
63 frame.InstructionIndex++;
64 Instruction[] instructions = frame.Interpreter.Instructions.Instructions;
65 ExceptionHandler handler;
66 object unwrappedException;
67 try
68 {
69 int num = frame.InstructionIndex;
70 while (num >= _tryHandler.TryStartIndex && num < _tryHandler.TryEndIndex)
71 {
72 num = (frame.InstructionIndex = num + instructions[num].Run(frame));
73 }
75 {
76 frame.InstructionIndex += instructions[num].Run(frame);
77 }
78 }
79 catch (Exception exception) when (_tryHandler.HasHandler(frame, exception, out handler, out unwrappedException))
80 {
81 frame.InstructionIndex += frame.Goto(handler.LabelIndex, unwrappedException, gotoExceptionHandler: true);
82 bool flag = false;
83 try
84 {
85 int num2 = frame.InstructionIndex;
86 while (num2 >= handler.HandlerStartIndex && num2 < handler.HandlerEndIndex)
87 {
88 num2 = (frame.InstructionIndex = num2 + instructions[num2].Run(frame));
89 }
91 {
92 frame.InstructionIndex += instructions[num2].Run(frame);
93 }
94 }
95 catch (RethrowException)
96 {
97 flag = true;
98 }
99 if (flag)
100 {
101 throw;
102 }
103 }
104 finally
105 {
107 {
108 int num3 = (frame.InstructionIndex = _tryHandler.FinallyStartIndex);
110 {
111 num3 = (frame.InstructionIndex = num3 + instructions[num3].Run(frame));
112 }
113 }
114 }
115 return frame.InstructionIndex - instructionIndex;
116 }
bool HasHandler(InterpretedFrame frame, Exception exception, [NotNullWhen(true)] out ExceptionHandler handler, out object unwrappedException)

References System.Linq.Expressions.Interpreter.EnterTryCatchFinallyInstruction._hasFinally, System.Linq.Expressions.Interpreter.IndexedBranchInstruction._labelIndex, System.Linq.Expressions.Interpreter.EnterTryCatchFinallyInstruction._tryHandler, System.exception, System.Linq.Expressions.Interpreter.TryCatchFinallyHandler.FinallyEndIndex, System.Linq.Expressions.Interpreter.TryCatchFinallyHandler.FinallyStartIndex, System.Linq.Expressions.Interpreter.InterpretedFrame.Goto(), System.Linq.Expressions.Interpreter.TryCatchFinallyHandler.GotoEndTargetIndex, System.Linq.Expressions.Interpreter.ExceptionHandler.HandlerEndIndex, System.Linq.Expressions.Interpreter.ExceptionHandler.HandlerStartIndex, System.Linq.Expressions.Interpreter.TryCatchFinallyHandler.HasHandler(), System.Linq.Expressions.Interpreter.InterpretedFrame.InstructionIndex, System.Linq.Expressions.Interpreter.InstructionArray.Instructions, System.Linq.Expressions.Interpreter.Interpreter.Instructions, System.Linq.Expressions.Interpreter.InterpretedFrame.Interpreter, System.Linq.Expressions.Interpreter.TryCatchFinallyHandler.IsFinallyBlockExist, System.Linq.Expressions.Interpreter.ExceptionHandler.LabelIndex, System.Linq.Expressions.Interpreter.InterpretedFrame.PushContinuation(), System.Linq.Expressions.Interpreter.Instruction.Run(), System.Linq.Expressions.Interpreter.TryCatchFinallyHandler.TryEndIndex, and System.Linq.Expressions.Interpreter.TryCatchFinallyHandler.TryStartIndex.