value.Walk: fix data race
Acquire a read lock when walking through a CUE value. Fixes #1494 Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
6ce362be5d
commit
e38be1a1fc
@ -185,7 +185,10 @@ func (v *Value) IsConcreteR(opts ...cue.Option) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v *Value) Walk(before func(*Value) bool, after func(*Value)) {
|
func (v *Value) Walk(before func(*Value) bool, after func(*Value)) {
|
||||||
// FIXME: lock?
|
// FIXME: this is a long lock
|
||||||
|
v.cc.rlock()
|
||||||
|
defer v.cc.runlock()
|
||||||
|
|
||||||
var (
|
var (
|
||||||
llBefore func(cue.Value) bool
|
llBefore func(cue.Value) bool
|
||||||
llAfter func(cue.Value)
|
llAfter func(cue.Value)
|
||||||
|
Reference in New Issue
Block a user