projects
/
platform
/
upstream
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ca82dd
)
Check for error type when getting type of binary expression.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 19 Jan 2011 16:03:55 +0000
(16:03 +0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 19 Jan 2011 16:03:55 +0000
(16:03 +0000)
From-SVN: r169002
gcc/go/gofrontend/expressions.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/expressions.cc
b/gcc/go/gofrontend/expressions.cc
index 819fb616452b786f59a3658526e2011b22cace03..5afe163b760671d5b5290d6d93989c11006fb078 100644
(file)
--- 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;