compiler: fix glitch when inlining method with empty param/receiver
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 25 Apr 2019 01:13:22 +0000 (01:13 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 25 Apr 2019 01:13:22 +0000 (01:13 +0000)
commitce0f706246b340516a425d044770b97579e6c2e3
treeacab9ef3baafb89ea90345cf3d79942c7c29f9c3
parent6aa6cbacc8c1b3aa35b8382cbc387de05a9461f9
compiler: fix glitch when inlining method with empty param/receiver

    Fix a problem with Function_declaration::import_function relating to
    how no-name or "sink" parameters are handled. In Gogo::start_function
    (for the non-inline case) when parameter bindings are being added,
    parameters with empty/sink names are renamed to synthesized "r.%d" /
    "p.%d" names so as to avoid collisions. This same handling needs to be
    present when creating the bindings for an inline function that's being
    instantiated after being read from export data.

    Fixes golang/go#31637.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/173538

From-SVN: r270564
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/gogo.cc
gcc/go/gofrontend/gogo.h