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 e1d59bef798bb132a5fb25a15a8e0111ab173be8..c17cc9efc002dae974eca3c01ca893da7586c4d5 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)