Merge pull request #1495 from aluzzardi/fix-data-race

value.Walk: fix data race
This commit is contained in:
Andrea Luzzardi 2022-01-25 17:21:38 -08:00 committed by GitHub
commit c6d4ffb75e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,7 +185,10 @@ func (v *Value) IsConcreteR(opts ...cue.Option) error {
}
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 (
llBefore func(cue.Value) bool
llAfter func(cue.Value)