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.

Change-Id: If2a802a1c95a557a31190cb8c9de3c9ef3fbcd58
Reviewed-by: Ian Lance Taylor <>
2 files changed