Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ ValidateJump()

void System.Linq.Expressions.Interpreter.LabelInfo.ValidateJump ( LabelScopeInfo reference)
inlineprivate

Definition at line 67 of file LabelInfo.cs.

68 {
69 for (LabelScopeInfo labelScopeInfo = reference; labelScopeInfo != null; labelScopeInfo = labelScopeInfo.Parent)
70 {
72 {
73 return;
74 }
75 if (labelScopeInfo.Kind == LabelScopeKind.Finally || labelScopeInfo.Kind == LabelScopeKind.Filter)
76 {
77 break;
78 }
79 }
80 _acrossBlockJump = true;
81 if (_node != null && _node.Type != typeof(void))
82 {
83 throw Error.NonLocalJumpWithValue(_node.Name);
84 }
86 {
87 throw Error.AmbiguousJump(_node.Name);
88 }
89 LabelScopeInfo labelScopeInfo2 = FirstDefinition();
90 LabelScopeInfo labelScopeInfo3 = CommonNode(labelScopeInfo2, reference, (LabelScopeInfo b) => b.Parent);
92 {
93 if (labelScopeInfo4.Kind == LabelScopeKind.Finally)
94 {
95 throw Error.ControlCannotLeaveFinally();
96 }
97 if (labelScopeInfo4.Kind == LabelScopeKind.Filter)
98 {
99 throw Error.ControlCannotLeaveFilterTest();
100 }
101 }
103 {
104 if (!labelScopeInfo5.CanJumpInto)
105 {
106 if (labelScopeInfo5.Kind == LabelScopeKind.Expression)
107 {
108 throw Error.ControlCannotEnterExpression();
109 }
110 throw Error.ControlCannotEnterTry();
111 }
112 }
113 }

References System.Linq.Expressions.Interpreter.LabelInfo._acrossBlockJump, System.Linq.Expressions.Interpreter.LabelInfo._node, System.Linq.Expressions.Error.AmbiguousJump(), System.Linq.Expressions.Error.ControlCannotEnterExpression(), System.Linq.Expressions.Error.ControlCannotEnterTry(), System.Linq.Expressions.Error.ControlCannotLeaveFilterTest(), System.Linq.Expressions.Error.ControlCannotLeaveFinally(), System.Linq.Expressions.Interpreter.LabelInfo.DefinedIn(), System.Linq.Expressions.Interpreter.LabelInfo.FirstDefinition(), System.Linq.Expressions.Interpreter.LabelInfo.HasMultipleDefinitions, System.Linq.Expressions.LabelTarget.Name, System.Linq.Expressions.Error.NonLocalJumpWithValue(), and System.Linq.Expressions.LabelTarget.Type.

Referenced by System.Linq.Expressions.Interpreter.LabelInfo.Define(), and System.Linq.Expressions.Interpreter.LabelInfo.Reference().