Avoid dangling open function after erroneous method expression.
authorIan Lance Taylor <ian@gcc.gnu.org>
Sat, 19 Feb 2011 03:37:30 +0000 (03:37 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Sat, 19 Feb 2011 03:37:30 +0000 (03:37 +0000)
From-SVN: r170302

gcc/go/gofrontend/expressions.cc

index e1d59be..c17cc9e 100644 (file)
@@ -10335,7 +10335,10 @@ Selector_expression::lower_method_expression(Gogo* gogo)
   // Even though we found the method above, if it has an error type we
   // may see an error here.
   if (bm->is_error_expression())
-    return bm;
+    {
+      gogo->finish_function(location);
+      return bm;
+    }
 
   Expression_list* args;
   if (method_parameters == NULL)