diff --git a/src/cmd/compile/internal/gc/dwinl.go b/src/cmd/compile/internal/gc/dwinl.go index 06eebc96e50..e4eae3e87f6 100644 --- a/src/cmd/compile/internal/gc/dwinl.go +++ b/src/cmd/compile/internal/gc/dwinl.go @@ -129,10 +129,10 @@ func assembleInlines(fnsym *obj.LSym, fn *Node, dwVars []*dwarf.Var) dwarf.InlCa DeclLine: sl[j].DeclLine, DeclCol: sl[j].DeclCol, } - returnTmp := strings.HasPrefix(sl[j].Name, "~r") + synthesized := strings.HasPrefix(sl[j].Name, "~r") || canonName == "_" if idx, found := m[vp]; found { sl[j].ChildIndex = int32(idx) - sl[j].IsInAbstract = !returnTmp + sl[j].IsInAbstract = !synthesized sl[j].Name = canonName } else { // Variable can't be found in the pre-inline dcl list. @@ -140,10 +140,7 @@ func assembleInlines(fnsym *obj.LSym, fn *Node, dwVars []*dwarf.Var) dwarf.InlCa // because a composite variable was split into pieces, // and we're looking at a piece. We can also see // return temps (~r%d) that were created during - // lowering. - if ii != 0 && !returnTmp { - Fatalf("unexpected: can't find var %s in preInliningDcls for %v\n", sl[j].Name, Ctxt.InlTree.InlinedFunction(int(ii-1))) - } + // lowering, or unnamed params ("_"). sl[j].ChildIndex = int32(synthCount) synthCount += 1 } diff --git a/test/fixedbugs/issue23179.dir/a.go b/test/fixedbugs/issue23179.dir/a.go index 1b796660fdc..3d2816fc69d 100644 --- a/test/fixedbugs/issue23179.dir/a.go +++ b/test/fixedbugs/issue23179.dir/a.go @@ -4,6 +4,10 @@ package a -func F(x int, _ int, _ bool) int { +type Large struct { + x [256]int +} + +func F(x int, _ int, _ bool, _ Large) int { return x } diff --git a/test/fixedbugs/issue23179.dir/b.go b/test/fixedbugs/issue23179.dir/b.go index edf5e6d8126..bec3d15e1e1 100644 --- a/test/fixedbugs/issue23179.dir/b.go +++ b/test/fixedbugs/issue23179.dir/b.go @@ -7,5 +7,5 @@ package b import "a" func G(x int) int { - return a.F(x, 1, false) + return a.F(x, 1, false, a.Large{}) }