go/test/typeparam
Dan Scales 55c517a8b3 cmd/compile: fix handling of ir.CurFunc during stenciling
The transform functions (specifically transformArgs, which is used from
transformCall/transformReturn) require that ir.CurFunc is set correctly.
Since transformCall() is used on the call of an instantiated generic
function, we need to set ir.CurFunc correctly in stencil(). Also,
correctly save/restore ir.CurFunc in genericSubst().

Without this fix, ir.CurFunc can be nil when we call TransformCall()
from stencil(), which leads to some temp variables being added
incorrectly to ir.TodoFunc (which leads to the fatal panic in the
issue).

Fixes #45722

Change-Id: Iddf4a67d28f2100dde8cde5dbc9ca1e00dad6089
Reviewed-on: https://go-review.googlesource.com/c/go/+/313869
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
2021-04-27 16:55:20 +00:00
..
absdiff.go cmd/compile: getting more built-ins to work with generics 2021-03-17 16:53:00 +00:00
adder.go cmd/compile: replace calls to typecheck with transform functions 2021-03-23 04:23:52 +00:00
append.go cmd/compile: getting more built-ins to work with generics 2021-03-17 16:53:00 +00:00
chans.go cmd/compile: add support for generic channels and type conversion during calls 2021-03-15 20:28:10 +00:00
combine.go
cons.go cmd/compile: add support for generic channels and type conversion during calls 2021-03-15 20:28:10 +00:00
double.go cmd/compile: get untyped constants working in generic functions 2021-03-18 22:18:32 +00:00
fact.go
graph.go cmd/compile: deal with comparable embedded in a constraint 2021-03-16 18:42:06 +00:00
importtest.go
index.go
interfacearg.go cmd/compile: fix creation of named generic types (setting of t.nod) 2021-03-30 04:48:27 +00:00
issue45547.go cmd/compile: look for function in instantiations in all global assignments 2021-04-15 00:14:55 +00:00
issue45722.go cmd/compile: fix handling of ir.CurFunc during stenciling 2021-04-27 16:55:20 +00:00
list.go cmd/compile: get untyped constants working in generic functions 2021-03-18 22:18:32 +00:00
list2.go cmd/compile: replace calls to typecheck with transform functions 2021-03-23 04:23:52 +00:00
lockable.go
map.go
maps.go cmd/compile: add support for generic maps 2021-03-15 20:28:34 +00:00
metrics.go cmd/compile: fix case where func-valued field of a generic type is called 2021-03-15 20:29:11 +00:00
min.go
ordered.go
orderedmap.go cmd/compile: fix case where func-valued field of a generic type is called 2021-03-15 20:29:11 +00:00
pair.go
pragma.go cmd/compile: propagate pragmas from generic function to stenciled implementation 2021-04-15 00:29:05 +00:00
sets.go cmd/compile: add support for generic maps 2021-03-15 20:28:34 +00:00
settable.go cmd/compile: getting more built-ins to work with generics 2021-03-17 16:53:00 +00:00
slices.go cmd/compile: fix case where func-valued field of a generic type is called 2021-03-15 20:29:11 +00:00
smallest.go
smoketest.go
stringable.go
stringer.go
struct.go
sum.go
tparam1.go
typelist.go cmd/compile: deal correctly with unnamed function params during stenciling 2021-03-31 00:52:26 +00:00
value.go