[Mono.Debugger.Soft] Implement IsGenericType/Method for protocol < 2.12
[mono.git] / mcs / mcs / lambda.cs
index 3ede750dbbd2f15809114a2e54b60b3fbb0dd40f..f1cc07b195866435cc084e0af900a215caa3d28c 100644 (file)
@@ -7,6 +7,7 @@
 // Dual licensed under the terms of the MIT X11 or GNU GPL
 //
 // Copyright 2007-2008 Novell, Inc
+// Copyright 2011 Xamarin Inc
 //
 
 #if STATIC
@@ -123,6 +124,11 @@ namespace Mono.CSharp {
                {
                        return "lambda expression";
                }
+               
+               public override object Accept (StructuralVisitor visitor)
+               {
+                       return visitor.Visit (this);
+               }
        }
 
        class LambdaMethod : AnonymousMethodBody
@@ -189,7 +195,11 @@ namespace Mono.CSharp {
                {
                        if (statement != null) {
                                statement.EmitStatement (ec);
-                               ec.Emit (OpCodes.Ret);
+                               if (unwind_protect)
+                                       ec.Emit (OpCodes.Leave, ec.CreateReturnLabel ());
+                               else {
+                                       ec.Emit (OpCodes.Ret);
+                               }
                                return;
                        }