protect node slices
This commit is contained in:
parent
ba7be0c5f2
commit
fd0a780a76
@ -281,10 +281,11 @@ func checkPending(p *pending, r reflect.Value) (applyRef func(node) node, ref no
|
|||||||
applyRef = func(n node) node {
|
applyRef = func(n node) node {
|
||||||
nr = p.values[key]
|
nr = p.values[key]
|
||||||
if nr.refCount > 0 {
|
if nr.refCount > 0 {
|
||||||
n.parts = append(
|
def := []interface{}{"r", nr.id, "="}
|
||||||
[]interface{}{"r", nr.id, "="},
|
pp := make([]interface{}, len(def)+len(n.parts))
|
||||||
n.parts...,
|
copy(pp, def)
|
||||||
)
|
copy(pp[len(def):], n.parts)
|
||||||
|
n.parts = pp
|
||||||
}
|
}
|
||||||
|
|
||||||
delete(p.values, key)
|
delete(p.values, key)
|
||||||
|
Loading…
Reference in New Issue
Block a user