diff mbox

Go patch committed: Don't crash when referring to method without call

Message ID mcr8vxnij44.fsf@google.com
State New
Headers show

Commit Message

Ian Lance Taylor Feb. 10, 2011, 11:07 p.m. UTC
This patch to the Go frontend avoids a crash when a method of an
expression is referred to directly without calling it.  Bootstrapped and
ran Go testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
diff mbox

Patch

diff -r aee4316d9007 go/expressions.cc
--- a/go/expressions.cc	Thu Feb 10 14:33:51 2011 -0800
+++ b/go/expressions.cc	Thu Feb 10 15:04:01 2011 -0800
@@ -6397,7 +6397,8 @@ 
 tree
 Bound_method_expression::do_get_tree(Translate_context*)
 {
-  gcc_unreachable();
+  error_at(this->location(), "reference to method other than calling it");
+  return error_mark_node;
 }
 
 // Make a method expression.