]> Cypherpunks.ru repositories - gostls13.git/commit
test: add escape test for reflect.Value operations
authorCherry Mui <cherryyz@google.com>
Mon, 10 Oct 2022 22:05:16 +0000 (18:05 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 12 May 2023 23:13:19 +0000 (23:13 +0000)
commit994eca4883b613ee845abb101ed4c3ffef80e428
treedc3655cfee0f37875611c66b39bc53b1586cdaa1
parent719e2b6f0991f89702a86d46bead2b23efc82aa7
test: add escape test for reflect.Value operations

With CL 408826 reflect.Value does not always escape. We need to
make sure Value operations does (or does not) escape the Value
correctly. This CL adds a test.

There are still a few unfortunate cases, where some Value
operations escape more than necessary (comparing to a non-reflect
version of the code), but hard to fix. These are mostly that a
Value would escape conditionally (mostly on the type of the Value),
but currently we don't have a good way to express that.

Change-Id: I9fdfc7584670aa09c5a01f6b2803f2043aaddb65
Reviewed-on: https://go-review.googlesource.com/c/go/+/441938
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
test/escape_reflect.go [new file with mode: 0644]