Don't crash looking for methods of pointer to error type.
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 23 Feb 2011 05:53:37 +0000 (05:53 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 23 Feb 2011 05:53:37 +0000 (05:53 +0000)
From-SVN: r170431

gcc/go/gofrontend/types.cc

index 90bc4e1d4a9d0a83ced2daf3bbf94c854000808f..8ce39b790c54cc2207a88b80d016a3612c06158a 100644 (file)
@@ -7799,6 +7799,8 @@ Type::bind_field_or_method(Gogo* gogo, const Type* type, Expression* expr,
     {
       expr = Expression::make_unary(OPERATOR_MULT, expr, location);
       type = type->points_to();
+      if (type->deref()->is_error_type())
+       return Expression::make_error(location);
       nt = type->points_to()->named_type();
       st = type->points_to()->struct_type();
       it = type->points_to()->interface_type();