aboutsummaryrefslogtreecommitdiff
path: root/src/encoding
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-07-27 13:52:04 -0400
committerRuss Cox <rsc@golang.org>2015-07-27 18:03:45 +0000
commit765cea2b26b1f65b1865185526065db893feb346 (patch)
treeba3efb9ee5b19797f0aea4c91c37caea554e9564 /src/encoding
parent3f98b6a573a98470ce02344c5b91bf4d3cd38e14 (diff)
downloadgo-765cea2b26b1f65b1865185526065db893feb346.tar.xz
encoding/xml: fix race using finfo.parents in s.trim
This race was identified in #9796, but a sequence of fixes proposed in golang.org/cl/4152 were rolled into golang.org/cl/5910 which both fixed the race and modified the name space behavior. We rolled back the name space changes and lost the race fix. Fix the race separate from the name space changes, following the suggestion made by Roger Peppe in https://go-review.googlesource.com/#/c/4152/7/src/encoding/xml/marshal.go@897 Fixes #9796. Fixes #11885. Change-Id: Ib2b68982da83dee9e04db8b8465a8295259bba46 Reviewed-on: https://go-review.googlesource.com/12687 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/encoding')
-rw-r--r--src/encoding/xml/marshal.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/encoding/xml/marshal.go b/src/encoding/xml/marshal.go
index b8dad494fb..86d1422a5b 100644
--- a/src/encoding/xml/marshal.go
+++ b/src/encoding/xml/marshal.go
@@ -945,7 +945,7 @@ func (s *parentStack) trim(parents []string) error {
return err
}
}
- s.stack = parents[:split]
+ s.stack = s.stack[:split]
return nil
}