]> Cypherpunks repositories - gostls13.git/commitdiff
reflect: document that InterfaceData is a low-entropy RNG
authorMatthew Dempsky <mdempsky@google.com>
Thu, 24 Jun 2021 17:44:39 +0000 (10:44 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 24 Jun 2021 20:04:22 +0000 (20:04 +0000)
Change-Id: Ie26b9060630e2e774ac23d8492eaaf785bfca6b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/330709
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>

src/reflect/value.go

index 6ba6202a1a1b1b1470a5d6842dec6dabb0ce8f26..9dce251ac57588af7ecd38c42a1635b9f6ac5d50 100644 (file)
@@ -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