cmd/compile: investigate proper use of Node.copy (reminder issue) #27765
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Node.copy doesn't do anything special with Node.Orig. This can cause problems when the original node (n) is modified and n.Orig == n (that is, when n.Orig points to itself).
The code takes care of this at the call site at (cmd/compile/internal/gc/) const.go:1203 and also typecheck.go:2926 ( https://go-review.googlesource.com/c/go/+/136395 ). See also #26855.
Making the appropriate change in Node.copy (and remove the special handling outside) appears to introduce failures. Investigate.
cc: @mdempsky
The text was updated successfully, but these errors were encountered: