Skip to content

Commit 276457a

Browse files
authored
Merge pull request #654 from typeless/fix-too-large-arrary-error
Fix build failure on Windows/386
2 parents f3aa5ce + d12a138 commit 276457a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sqlite3_opt_unlock_notify.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ extern void unlock_notify_callback(void *arg, int argc);
1919
import "C"
2020
import (
2121
"fmt"
22+
"math"
2223
"sync"
2324
"unsafe"
2425
)
@@ -59,7 +60,7 @@ func (t *unlock_notify_table) get(h uint) chan struct{} {
5960
//export unlock_notify_callback
6061
func unlock_notify_callback(argv unsafe.Pointer, argc C.int) {
6162
for i := 0; i < int(argc); i++ {
62-
parg := ((*(*[1 << 30]*[1]uint)(argv))[i])
63+
parg := ((*(*[(math.MaxInt32 - 1) / unsafe.Sizeof(uintptr)]*[1]uint)(argv))[i])
6364
arg := *parg
6465
h := arg[0]
6566
c := unt.get(h)

0 commit comments

Comments
 (0)