cmd/compile: .closureptr elided in optimized binaries #69307
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
(also reproduces on tip)
Given this sample program using range-over-func the DIE emitted for
main.PrintAllElements[go.shape.string]-range1
when optimizations are enabled is:No entries for
.closureptr
are generated, presumably because all the stores related to.closureptr
are optimized away.Originally reported as go-delve/delve#3806 (where it triggers other related delve bugs).
We could also say that with optimized binaries we do not correlate closure bodies with their parent in the debugger, or that we do a best effort thing and occasionally get it wrong (I suspect actually keeping track of .closureptr could have negative performance effects).
cc @dr2chase
The text was updated successfully, but these errors were encountered: