Skip to content

Commit

Permalink
smaller comment
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Jul 10, 2024
1 parent f4a2fed commit 67fc535
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions interp/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -996,11 +996,8 @@ func genFunctionWrapper(n *node) func(*frame) reflect.Value {
return func(f *frame) reflect.Value {
v := value(f)
if !isDefer && v.Kind() == reflect.Func {
// per #1634, if v is already a func, then don't re-wrap! critically, the original wrapping
// clones the frame, whereas the one here (below) does _not_ clone the frame, so it doesn't
// generate the proper closure capture effects!
// this path is the same as genValueAsFunctionWrapper which is the path taken above if
// the value has an associated node, which happens when you do f := func() ..
// fixes #1634, if v is already a func, then don't re-wrap
// because original wrapping cloned the frame but this doesn't
return v
}

Expand Down

0 comments on commit 67fc535

Please sign in to comment.