diff --git a/bindings/js/minify.go b/bindings/js/minify.go index 6b39ef2bc8..7b33ff0dc6 100644 --- a/bindings/js/minify.go +++ b/bindings/js/minify.go @@ -25,7 +25,7 @@ func init() { } func goBytes(str *C.char, length C.longlong) []byte { - return (*[1 << 31]byte)(unsafe.Pointer(str))[:length:length] + return (*[1 << 30]byte)(unsafe.Pointer(str))[:length:length] } func goStringArray(carr **C.char, length C.longlong) []string { @@ -34,7 +34,7 @@ func goStringArray(carr **C.char, length C.longlong) []string { } strs := make([]string, length) - arr := (*[1<<31 - 1]*C.char)(unsafe.Pointer(carr))[:length:length] + arr := (*[1 << 30]*C.char)(unsafe.Pointer(carr))[:length:length] for i := 0; i < int(length); i++ { strs[i] = C.GoString(arr[i]) } diff --git a/bindings/py/minify.go b/bindings/py/minify.go index 6b39ef2bc8..7b33ff0dc6 100644 --- a/bindings/py/minify.go +++ b/bindings/py/minify.go @@ -25,7 +25,7 @@ func init() { } func goBytes(str *C.char, length C.longlong) []byte { - return (*[1 << 31]byte)(unsafe.Pointer(str))[:length:length] + return (*[1 << 30]byte)(unsafe.Pointer(str))[:length:length] } func goStringArray(carr **C.char, length C.longlong) []string { @@ -34,7 +34,7 @@ func goStringArray(carr **C.char, length C.longlong) []string { } strs := make([]string, length) - arr := (*[1<<31 - 1]*C.char)(unsafe.Pointer(carr))[:length:length] + arr := (*[1 << 30]*C.char)(unsafe.Pointer(carr))[:length:length] for i := 0; i < int(length); i++ { strs[i] = C.GoString(arr[i]) }