diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-02-18 01:45:49 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-02-18 01:45:49 +0000 |
commit | 2d9dc3c1b7be34442f224a10013dd5f3823c962a (patch) | |
tree | e25228b2da4ae13353eb247d3771352a182fb41e /pkg/usermem | |
parent | 45be62df210badd412752214925e0de28887ed54 (diff) | |
parent | f051ec64639b83faabcfe766ff078072def3c2aa (diff) |
Merge release-20210208.0-64-gf051ec646 (automated)
Diffstat (limited to 'pkg/usermem')
-rw-r--r-- | pkg/usermem/addr_range_seq_unsafe.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/usermem/addr_range_seq_unsafe.go b/pkg/usermem/addr_range_seq_unsafe.go index 495896ded..c9a1415a0 100644 --- a/pkg/usermem/addr_range_seq_unsafe.go +++ b/pkg/usermem/addr_range_seq_unsafe.go @@ -17,8 +17,9 @@ package usermem import ( "bytes" "fmt" - "reflect" "unsafe" + + "gvisor.dev/gvisor/pkg/gohacks" ) // An AddrRangeSeq represents a sequence of AddrRanges. @@ -163,8 +164,8 @@ func (ars AddrRangeSeq) externalTail() AddrRangeSeq { tailLimit = int64(ars.limit - headLen) } var extSlice []AddrRange - extSliceHdr := (*reflect.SliceHeader)(unsafe.Pointer(&extSlice)) - extSliceHdr.Data = uintptr(ars.data) + extSliceHdr := (*gohacks.SliceHeader)(unsafe.Pointer(&extSlice)) + extSliceHdr.Data = ars.data extSliceHdr.Len = ars.length extSliceHdr.Cap = ars.length return addrRangeSeqFromSliceLimited(extSlice[1:], tailLimit) |