From 9f83803fac4b1d29761cdba0cd64125907871010 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Wed, 3 Apr 2024 09:30:22 +0200 Subject: [PATCH] fix: fix up closure frame in mutual exclusive critical section --- interp/run.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/interp/run.go b/interp/run.go index dd2eebdc..1ec67609 100644 --- a/interp/run.go +++ b/interp/run.go @@ -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() { @@ -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 } }