mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-21 15:40:55 +08:00
compiler: Don't crash if writing type functions too late due to error.
From-SVN: r185080
This commit is contained in:
parent
5ceb809d01
commit
d111e30ef3
@ -398,6 +398,11 @@ class Gogo
|
||||
void
|
||||
write_specific_type_functions();
|
||||
|
||||
// Whether we are done writing out specific type functions.
|
||||
bool
|
||||
specific_type_functions_are_written() const
|
||||
{ return this->specific_type_functions_are_written_; }
|
||||
|
||||
// Traverse the tree. See the Traverse class.
|
||||
void
|
||||
traverse(Traverse*);
|
||||
|
@ -1790,6 +1790,12 @@ Type::write_specific_type_functions(Gogo* gogo, Named_type* name,
|
||||
{
|
||||
Location bloc = Linemap::predeclared_location();
|
||||
|
||||
if (gogo->specific_type_functions_are_written())
|
||||
{
|
||||
go_assert(saw_errors());
|
||||
return;
|
||||
}
|
||||
|
||||
Named_object* hash_fn = gogo->start_function(hash_name, hash_fntype, false,
|
||||
bloc);
|
||||
gogo->start_block(bloc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user