reflect: Fix invalid sharing in valueInterface.
From-SVN: r193614
This commit is contained in:
parent
822a258a98
commit
a3ce4803ea
|
@ -928,7 +928,7 @@ func valueInterface(v Value, safe bool) interface{} {
|
||||||
eface.typ = v.typ.runtimeType()
|
eface.typ = v.typ.runtimeType()
|
||||||
eface.word = v.iword()
|
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,
|
// eface.word is a pointer to the actual data,
|
||||||
// which might be changed. We need to return
|
// which might be changed. We need to return
|
||||||
// a pointer to unchanging data, so make a copy.
|
// a pointer to unchanging data, so make a copy.
|
||||||
|
|
Loading…
Reference in New Issue