Skip to content

Commit

Permalink
fix: fix up closure frame in mutual exclusive critical section
Browse files Browse the repository at this point in the history
  • Loading branch information
mvertes authored and traefiker committed Apr 3, 2024
1 parent 8f9c777 commit 9f83803
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions interp/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -1289,11 +1289,13 @@ func call(n *node) {
}

n.exec = func(f *frame) bltn {
f.mutex.Lock()
bf := value(f)
def, ok := bf.Interface().(*node)
if ok {
bf = def.rval
}
f.mutex.Unlock()

// Call bin func if defined
if bf.IsValid() {
Expand Down Expand Up @@ -1915,11 +1917,18 @@ func getFunc(n *node) {

// Interpreter code execution.
runCfg(n.child[3].start, fr2, n, n)

f.mutex.Lock()
getFrame(f, l).data[i] = o
f.mutex.Unlock()

return fr2.data[:numRet]
})

f.mutex.Lock()
getFrame(f, l).data[i] = fct
f.mutex.Unlock()

return next
}
}
Expand Down

0 comments on commit 9f83803

Please sign in to comment.