diff options
author | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2021-10-20 00:16:23 +0700 |
---|---|---|
committer | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2021-10-19 18:56:08 +0000 |
commit | 07e5527249cb0b152a3807d67ea83bafd71d2496 (patch) | |
tree | 8b46ff7a4717e053e8f77572799ab3915a74d672 /src/reflect/all_test.go | |
parent | d7149e502dfb13fdc94439eebaf1823a6c6dd84f (diff) | |
download | go-07e5527249cb0b152a3807d67ea83bafd71d2496.tar.gz go-07e5527249cb0b152a3807d67ea83bafd71d2496.zip |
reflect: fix methodValueCall code pointer mismatch in Value.Pointer
This is the port of CL 356809 for Value.Pointer to fix the mismatch of
methodValueCall code pointer.
Change-Id: I080ac41b94b44d878cd5896207a76a28c57fd48b
Reviewed-on: https://go-review.googlesource.com/c/go/+/356950
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/reflect/all_test.go')
-rw-r--r-- | src/reflect/all_test.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/reflect/all_test.go b/src/reflect/all_test.go index 91aac9cccb..fcd0e15f0a 100644 --- a/src/reflect/all_test.go +++ b/src/reflect/all_test.go @@ -7724,9 +7724,12 @@ func TestNotInHeapDeref(t *testing.T) { } func TestMethodCallValueCodePtr(t *testing.T) { - p := ValueOf(Point{}).Method(1).UnsafePointer() + m := ValueOf(Point{}).Method(1) want := MethodValueCallCodePtr() - if got := uintptr(p); got != want { + if got := uintptr(m.UnsafePointer()); got != want { + t.Errorf("methodValueCall code pointer mismatched, want: %v, got: %v", want, got) + } + if got := m.Pointer(); got != want { t.Errorf("methodValueCall code pointer mismatched, want: %v, got: %v", want, got) } } |