diff --git a/cpu_darwin.go b/cpu_darwin.go index e2c48d6..5af5635 100644 --- a/cpu_darwin.go +++ b/cpu_darwin.go @@ -17,6 +17,6 @@ func init() { if !haveAVX512 { // On some Macs, AVX512 detection is buggy, so fallback to sysctl b, _ := syscall.Sysctl("hw.optional.avx512f") - haveAVX512 = b[0] == 1 + haveAVX512 = len(b) > 0 && b[0] == 1 } }