Commit 65937ccf by Ian Lance Taylor

compiler: avoid crash on real declaration of type with existing method

    
    This avoids a compiler crash on invalid code.
    
    Fixes https://gcc.gnu.org/PR90272
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/174377

From-SVN: r270658
parent 1978e62d
b117b468264665cfe6ec2cf3affb48330a704fa7
9476f6183791477dd9b883f51e2a46b224227735
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
......@@ -7816,7 +7816,8 @@ Type_declaration::define_methods(Named_type* nt)
p != this->methods_.end();
++p)
{
if (!(*p)->func_value()->is_sink())
if ((*p)->is_function_declaration()
|| !(*p)->func_value()->is_sink())
nt->add_existing_method(*p);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment