reflect: Fix invalid sharing in valueInterface.

From-SVN: r193613
This commit is contained in:
Ian Lance Taylor 2012-11-19 05:33:54 +00:00
parent abafcfe5c4
commit ffafac224c
1 changed files with 1 additions and 1 deletions

View File

@ -841,7 +841,7 @@ func valueInterface(v Value, safe bool) interface{} {
eface.typ = v.typ.runtimeType()
eface.word = v.iword()
if v.flag&flagIndir != 0 && v.typ.size > ptrSize {
if v.flag&flagIndir != 0 && v.kind() != Ptr && v.kind() != UnsafePointer {
// eface.word is a pointer to the actual data,
// which might be changed. We need to return
// a pointer to unchanging data, so make a copy.