diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2010-12-15 01:45:57 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2010-12-15 01:45:57 +0000 |
commit | 2e3d957596e6c54bbeb1d080fcb4ca01e2a29b78 (patch) | |
tree | 8e4ef9538f6370c922253d92692f61f29953623e /gcc | |
parent | 3db1a28cced42f050f27fb7669101ab2193d9027 (diff) | |
download | gcc-2e3d957596e6c54bbeb1d080fcb4ca01e2a29b78.zip gcc-2e3d957596e6c54bbeb1d080fcb4ca01e2a29b78.tar.gz gcc-2e3d957596e6c54bbeb1d080fcb4ca01e2a29b78.tar.bz2 |
Don't store error types in the Type-to-GENERIC hash table.
From-SVN: r167838
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/types.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index 842b484..e0b039f 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -791,6 +791,9 @@ Type::get_tree(Gogo* gogo) || this->named_type() != NULL) return this->get_tree_without_hash(gogo); + if (this->is_error_type()) + return error_mark_node; + // To avoid confusing GIMPLE, we need to translate all identical Go // types to the same GIMPLE type. We use a hash table to do that. // There is no need to use the hash table for named types, as named @@ -807,6 +810,14 @@ Type::get_tree(Gogo* gogo) tree t = this->get_tree_without_hash(gogo); + // Don't store errors in the hash table. This type might be a + // pointer to an error type or something like that. Since error + // types are identical to everything else, that could cause us to + // return error_mark_node for pointers to any type, which will then + // confuse us later. + if (t == error_mark_node) + return error_mark_node; + if (ins.first->second == NULL_TREE) ins.first->second = t; else |