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:
8dcfef8
)
Don't crash on invalid type conversion.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 22 Dec 2010 06:17:55 +0000
(06:17 +0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 22 Dec 2010 06:17:55 +0000
(06:17 +0000)
From-SVN: r168161
gcc/go/gofrontend/expressions.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/expressions.cc
b/gcc/go/gofrontend/expressions.cc
index
525ede2
..
114712b
100644
(file)
--- a/
gcc/go/gofrontend/expressions.cc
+++ b/
gcc/go/gofrontend/expressions.cc
@@
-3242,6
+3242,18
@@
Type_conversion_expression::do_check_types(Gogo*)
Type* expr_type = this->expr_->type();
std::string reason;
+ if (type->is_error_type()
+ || type->is_undefined()
+ || expr_type->is_error_type()
+ || expr_type->is_undefined())
+ {
+ // Make sure we emit an error for an undefined type.
+ type->base();
+ expr_type->base();
+ this->set_is_error();
+ return;
+ }
+
if (this->may_convert_function_types_
&& type->function_type() != NULL
&& expr_type->function_type() != NULL)