From: Matthew Dempsky Date: Thu, 24 Jun 2021 17:44:39 +0000 (-0700) Subject: reflect: document that InterfaceData is a low-entropy RNG X-Git-Tag: go1.17rc1~49 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c309c89db5;p=gostls13.git reflect: document that InterfaceData is a low-entropy RNG Change-Id: Ie26b9060630e2e774ac23d8492eaaf785bfca6b7 Reviewed-on: https://go-review.googlesource.com/c/go/+/330709 Reviewed-by: Ian Lance Taylor Trust: Matthew Dempsky --- diff --git a/src/reflect/value.go b/src/reflect/value.go index 6ba6202a1a..9dce251ac5 100644 --- a/src/reflect/value.go +++ b/src/reflect/value.go @@ -1381,10 +1381,16 @@ func valueInterface(v Value, safe bool) interface{} { return packEface(v) } -// InterfaceData returns the interface v's value as a uintptr pair. +// InterfaceData returns a pair of unspecified uintptr values. // It panics if v's Kind is not Interface. +// +// In earlier versions of Go, this function returned the interface's +// value as a uintptr pair. As of Go 1.4, the implementation of +// interface values precludes any defined use of InterfaceData. +// +// Deprecated: The memory representation of interface values is not +// compatible with InterfaceData. func (v Value) InterfaceData() [2]uintptr { - // TODO: deprecate this v.mustBe(Interface) // We treat this as a read operation, so we allow // it even for unexported data, because the caller