From 57872856e8c5b5de1381c601e6580877b0f37f44 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 26 Jan 2021 14:48:27 +0100 Subject: [PATCH] internal/unsafe: fix SliceOf to return len equals to cap Broken by gioui.org/commit/2dce8a0155ae192f54f74747d660b9f311e9e364, found while debugging the dormant OpenGL backend for Windows. Signed-off-by: Elias Naur --- internal/unsafe/unsafe.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/unsafe/unsafe.go b/internal/unsafe/unsafe.go index 3e963777..4687ca61 100644 --- a/internal/unsafe/unsafe.go +++ b/internal/unsafe/unsafe.go @@ -41,6 +41,7 @@ func SliceOf(s uintptr) []byte { h := (*reflect.SliceHeader)(unsafe.Pointer(&res)) h.Data = s h.Cap = 1 << 30 + h.Len = 1 << 30 return res }