Skip to content

cmd/compile: investigate proper use of Node.copy (reminder issue) #27765

@griesemer

Description

@griesemer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions