cmd/compile: avoid allocation when assigning a non-pointer value to an interface that already contains a value of the same type #65348
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FeatureRequest
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Go version
go1.22rc1 or older
Output of
go env
in your module/workspace:What did you do?
What did you see happen?
Storing a value of sufficiently-big type into an interface{}-typed variable unconditionally allocates.
What did you expect to see?
Storing even a big-typed value into an interface{}-typed variable should not allocate when the said variable already contains a value of the same big type. The resulting code should check that the type of the value in the interface is the same and overwrite the pointed-at value.
The text was updated successfully, but these errors were encountered: