aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-03-03 06:50:32 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-03-03 06:50:32 +0000
commitf7a10f0d78147f8fb1391474b76202ca37b0c998 (patch)
tree731337bcd47029b927a269a2a7f36a0713036e64 /gcc/go
parente2e280a3e5c6147f3b5a24981ddffc20c4f0bdf9 (diff)
downloadgcc-f7a10f0d78147f8fb1391474b76202ca37b0c998.zip
gcc-f7a10f0d78147f8fb1391474b76202ca37b0c998.tar.gz
gcc-f7a10f0d78147f8fb1391474b76202ca37b0c998.tar.bz2
Don't crash if erroneous type was not converted.
From-SVN: r170646
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/types.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc
index 2710408..0db5994 100644
--- a/gcc/go/gofrontend/types.cc
+++ b/gcc/go/gofrontend/types.cc
@@ -7300,7 +7300,12 @@ Named_type::do_get_tree(Gogo* gogo)
// We are not converting types. This should only be called if the
// type has already been converted.
- gcc_assert(this->is_converted_);
+ if (!this->is_converted_)
+ {
+ gcc_assert(saw_errors());
+ return error_mark_node;
+ }
+
gcc_assert(t != NULL_TREE && TYPE_SIZE(t) != NULL_TREE);
// Complete the tree.