aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-01-19 16:03:55 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-01-19 16:03:55 +0000
commite3e190507a1abb4a7b1933421d669652e9179dcb (patch)
tree76282f1192e6ab9df5a69e871233f9c3775f5a2f /gcc/go
parent0ca82dd6bae0055cf2c8b95823dea52a1d2e92f0 (diff)
downloadgcc-e3e190507a1abb4a7b1933421d669652e9179dcb.zip
gcc-e3e190507a1abb4a7b1933421d669652e9179dcb.tar.gz
gcc-e3e190507a1abb4a7b1933421d669652e9179dcb.tar.bz2
Check for error type when getting type of binary expression.
From-SVN: r169002
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/expressions.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 819fb61..5afe163 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -5396,7 +5396,11 @@ Binary_expression::do_type()
{
Type* left_type = this->left_->type();
Type* right_type = this->right_->type();
- if (!left_type->is_abstract() && left_type->named_type() != NULL)
+ if (left_type->is_error_type())
+ return left_type;
+ else if (right_type->is_error_type())
+ return right_type;
+ else if (!left_type->is_abstract() && left_type->named_type() != NULL)
return left_type;
else if (!right_type->is_abstract() && right_type->named_type() != NULL)
return right_type;