Avoid dangling open function after erroneous method expression.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 19 Feb 2011 03:37:30 +0000 (03:37 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 19 Feb 2011 03:37:30 +0000 (03:37 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170302 138bc75d-0d04-0410-961f-82ee72b054a4

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)