Commit ab86687f by Ian Lance Taylor

compiler: pass correct 'function' flag to circular_pointer_type

    
    The code in Named_type::do_get_backend was not passing the correct
    flag value for circular function types to Backend::circular_pointer_type
    (it was always setting this flag to false). Pass a true value if the
    type being converted is a function type.
    
    Reviewed-on: https://go-review.googlesource.com/49330

From-SVN: r250325
parent eb80664a
21775ae119830810d9e415a02e85349f4190c68c 0036bd04d077f8bbe5aa9a62fb8830c53068209e
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -10994,13 +10994,13 @@ Named_type::do_get_backend(Gogo* gogo) ...@@ -10994,13 +10994,13 @@ Named_type::do_get_backend(Gogo* gogo)
if (this->seen_in_get_backend_) if (this->seen_in_get_backend_)
{ {
this->is_circular_ = true; this->is_circular_ = true;
return gogo->backend()->circular_pointer_type(bt, false); return gogo->backend()->circular_pointer_type(bt, true);
} }
this->seen_in_get_backend_ = true; this->seen_in_get_backend_ = true;
bt1 = Type::get_named_base_btype(gogo, base); bt1 = Type::get_named_base_btype(gogo, base);
this->seen_in_get_backend_ = false; this->seen_in_get_backend_ = false;
if (this->is_circular_) if (this->is_circular_)
bt1 = gogo->backend()->circular_pointer_type(bt, false); bt1 = gogo->backend()->circular_pointer_type(bt, true);
if (!gogo->backend()->set_placeholder_pointer_type(bt, bt1)) if (!gogo->backend()->set_placeholder_pointer_type(bt, bt1))
bt = gogo->backend()->error_type(); bt = gogo->backend()->error_type();
return bt; return bt;
......
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