Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: redundant delete on s.vars in ssagen/ssa.go #58729

Closed
tianxiaogu opened this issue Feb 25, 2023 · 1 comment
Closed

cmd/compile: redundant delete on s.vars in ssagen/ssa.go #58729

tianxiaogu opened this issue Feb 25, 2023 · 1 comment
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@tianxiaogu
Copy link

In the following code snippet, line 6,381 deletes typVar from map s.vars. However, s.vars is assigned to a new empty map in s.startblock (line 6,377) and there is no update to s.vars after that. Do we need to explicitly delete typVar from s.vars?

// Merge point.
bEnd := s.f.NewBlock(ssa.BlockPlain)
bOk.AddEdgeTo(bEnd)
bFail.AddEdgeTo(bEnd)
s.startBlock(bEnd)
idata := s.newValue1(ssa.OpIData, byteptr, iface)
res = s.newValue2(ssa.OpIMake, dst, s.variable(typVar, byteptr), idata)
resok = cond
delete(s.vars, typVar)
return

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Feb 25, 2023
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/471355 mentions this issue: cmd/compile: eliminate a few redundant deletions of internal/ssagen.state.vars

@panjf2000 panjf2000 added the NeedsFix The path to resolution is known, but the work has not been done. label Feb 25, 2023
@panjf2000 panjf2000 added this to the Backlog milestone Feb 25, 2023
@golang golang locked and limited conversation to collaborators Mar 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants