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

◆ EmitTryExpression()

void System.Linq.Expressions.Compiler.LambdaCompiler.EmitTryExpression ( Expression expr)
inlineprivate

Definition at line 3340 of file LambdaCompiler.cs.

3341 {
3342 TryExpression tryExpression = (TryExpression)expr;
3343 CheckTry();
3347 Type type = tryExpression.Type;
3348 LocalBuilder local = null;
3349 if (type != typeof(void))
3350 {
3351 local = GetLocal(type);
3353 }
3354 foreach (CatchBlock handler in tryExpression.Handlers)
3355 {
3357 if (handler.Filter == null)
3358 {
3359 _ilg.BeginCatchBlock(handler.Test);
3360 }
3361 else
3362 {
3364 }
3365 EnterScope(handler);
3366 EmitCatchStart(handler);
3367 EmitExpression(handler.Body);
3368 if (type != typeof(void))
3369 {
3371 }
3372 ExitScope(handler);
3374 }
3375 if (tryExpression.Finally != null || tryExpression.Fault != null)
3376 {
3378 if (tryExpression.Finally != null)
3379 {
3381 }
3382 else
3383 {
3385 }
3389 }
3390 else
3391 {
3393 }
3394 if (type != typeof(void))
3395 {
3398 }
3400 }
virtual void Emit(OpCode opcode)
virtual void BeginCatchBlock(Type exceptionType)
static readonly OpCode Stloc
Definition OpCodes.cs:429
static readonly OpCode Ldloc
Definition OpCodes.cs:425

References System.Linq.Expressions.Compiler.LambdaCompiler._ilg, System.Reflection.Emit.ILGenerator.BeginCatchBlock(), System.Reflection.Emit.ILGenerator.BeginExceptFilterBlock(), System.Reflection.Emit.ILGenerator.BeginExceptionBlock(), System.Reflection.Emit.ILGenerator.BeginFaultBlock(), System.Reflection.Emit.ILGenerator.BeginFinallyBlock(), System.Linq.Expressions.CatchBlock.Body, System.Linq.Expressions.Compiler.LambdaCompiler.CheckTry(), System.Reflection.Emit.ILGenerator.Emit(), System.Linq.Expressions.Compiler.LambdaCompiler.EmitCatchStart(), System.Linq.Expressions.Compiler.LambdaCompiler.EmitExpression(), System.Linq.Expressions.Compiler.LambdaCompiler.EmitExpressionAsVoid(), System.Reflection.Emit.ILGenerator.EndExceptionBlock(), System.Linq.Expressions.Compiler.LambdaCompiler.EnterScope(), System.Linq.Expressions.Compiler.LambdaCompiler.ExitScope(), System.Linq.Expressions.CatchBlock.Filter, System.Linq.Expressions.Compiler.LambdaCompiler.FreeLocal(), System.Linq.Expressions.Compiler.LambdaCompiler.GetLocal(), System.Reflection.Emit.OpCodes.Ldloc, System.Linq.Expressions.Compiler.LambdaCompiler.PopLabelBlock(), System.Linq.Expressions.Compiler.LambdaCompiler.PushLabelBlock(), System.Reflection.Emit.OpCodes.Stloc, System.Linq.Expressions.CatchBlock.Test, and System.type.

Referenced by System.Linq.Expressions.Compiler.LambdaCompiler.EmitExpression().