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

◆ RewriteTryExpression()

Result System.Linq.Expressions.Compiler.StackSpiller.RewriteTryExpression ( Expression expr,
Stack stack )
inlineprivate

Definition at line 1113 of file StackSpiller.cs.

1114 {
1115 TryExpression tryExpression = (TryExpression)expr;
1116 Result result = RewriteExpression(tryExpression.Body, Stack.Empty);
1118 CatchBlock[] array = null;
1119 RewriteAction rewriteAction = result.Action;
1120 if (readOnlyCollection != null)
1121 {
1122 for (int i = 0; i < readOnlyCollection.Count; i++)
1123 {
1124 RewriteAction rewriteAction2 = result.Action;
1125 CatchBlock catchBlock = readOnlyCollection[i];
1126 Expression filter = catchBlock.Filter;
1127 if (catchBlock.Filter != null)
1128 {
1129 Result result2 = RewriteExpression(catchBlock.Filter, Stack.Empty);
1130 rewriteAction |= result2.Action;
1131 rewriteAction2 |= result2.Action;
1132 filter = result2.Node;
1133 }
1134 Result result3 = RewriteExpression(catchBlock.Body, Stack.Empty);
1135 rewriteAction |= result3.Action;
1136 if ((rewriteAction2 | result3.Action) != 0)
1137 {
1138 catchBlock = Expression.MakeCatchBlock(catchBlock.Test, catchBlock.Variable, result3.Node, filter);
1139 if (array == null)
1140 {
1142 }
1143 }
1144 if (array != null)
1145 {
1146 array[i] = catchBlock;
1147 }
1148 }
1149 }
1150 Result result4 = RewriteExpression(tryExpression.Fault, Stack.Empty);
1151 rewriteAction |= result4.Action;
1152 Result result5 = RewriteExpression(tryExpression.Finally, Stack.Empty);
1153 rewriteAction |= result5.Action;
1154 if (stack != 0)
1155 {
1156 rewriteAction = RewriteAction.SpillStack;
1157 }
1158 if (rewriteAction != 0)
1159 {
1160 if (array != null)
1161 {
1163 }
1164 expr = new TryExpression(tryExpression.Type, result.Node, result5.Node, result4.Node, readOnlyCollection);
1165 }
1166 return new Result(rewriteAction, expr);
1167 }
Result RewriteExpression(Expression node, Stack stack)

References System.Linq.Expressions.Compiler.StackSpiller.Result.Action, System.array, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Linq.Expressions.Expression< TDelegate >.MakeCatchBlock(), System.Linq.Expressions.Compiler.StackSpiller.Result.Node, and System.Linq.Expressions.Compiler.StackSpiller.RewriteExpression().

Referenced by System.Linq.Expressions.Compiler.StackSpiller.RewriteExpression().