From 0d2359b64f319d534ed25ecea800d0e17f5d53d4 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Wed, 16 Sep 2015 15:58:07 +0900 Subject: [PATCH] fix #238 --- callback.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/callback.go b/callback.go index 7a0a995..ee9d40c 100644 --- a/callback.go +++ b/callback.go @@ -29,14 +29,14 @@ import ( //export callbackTrampoline func callbackTrampoline(ctx *C.sqlite3_context, argc int, argv **C.sqlite3_value) { - args := (*[math.MaxInt32 - 1]*C.sqlite3_value)(unsafe.Pointer(argv))[:argc:argc] + args := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.sqlite3_value)(nil))]*C.sqlite3_value)(unsafe.Pointer(argv))[:argc:argc] fi := (*functionInfo)(unsafe.Pointer(C.sqlite3_user_data(ctx))) fi.Call(ctx, args) } //export stepTrampoline func stepTrampoline(ctx *C.sqlite3_context, argc int, argv **C.sqlite3_value) { - args := (*[math.MaxInt32 - 1]*C.sqlite3_value)(unsafe.Pointer(argv))[:argc:argc] + args := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.sqlite3_value)(nil))]*C.sqlite3_value)(unsafe.Pointer(argv))[:argc:argc] ai := (*aggInfo)(unsafe.Pointer(C.sqlite3_user_data(ctx))) ai.Step(ctx, args) }