mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-25 00:36:56 +02:00
fix bus error
This commit is contained in:
parent
80531b53e0
commit
a210874c46
1 changed files with 6 additions and 6 deletions
|
|
@ -436,7 +436,7 @@ int array_append(struct Array *array, const void *element) {
|
|||
return SQLITE_NOMEM;
|
||||
}
|
||||
}
|
||||
memcpy((char *)(&array->z)[array->length * array->element_size], element,
|
||||
memcpy(&array->z[array->length * array->element_size], element,
|
||||
array->element_size);
|
||||
array->length++;
|
||||
return SQLITE_OK;
|
||||
|
|
@ -2517,7 +2517,7 @@ static int vec_npy_eachColumn(sqlite3_vtab_cursor *cur,
|
|||
case SQLITE_VEC_ELEMENT_TYPE_FLOAT32: {
|
||||
sqlite3_result_blob(
|
||||
context,
|
||||
(f32 *)(&pCur->vector)[pCur->iRowid * pCur->nDimensions * sizeof(f32)],
|
||||
&pCur->vector[pCur->iRowid * pCur->nDimensions * sizeof(f32)],
|
||||
pCur->nDimensions * sizeof(f32), SQLITE_STATIC);
|
||||
break;
|
||||
}
|
||||
|
|
@ -2531,7 +2531,7 @@ static int vec_npy_eachColumn(sqlite3_vtab_cursor *cur,
|
|||
switch (pCur->elementType) {
|
||||
case SQLITE_VEC_ELEMENT_TYPE_FLOAT32: {
|
||||
sqlite3_result_blob(context,
|
||||
(f32 *)(&pCur->fileBuffer)[pCur->bufferIndex *
|
||||
&pCur->fileBuffer[pCur->bufferIndex *
|
||||
pCur->nDimensions * sizeof(f32)],
|
||||
pCur->nDimensions * sizeof(f32), SQLITE_TRANSIENT);
|
||||
break;
|
||||
|
|
@ -5688,7 +5688,7 @@ __declspec(dllexport)
|
|||
const int DEFAULT_FLAGS =
|
||||
SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC;
|
||||
|
||||
const struct {
|
||||
static const struct {
|
||||
char *zFName;
|
||||
void (*xFunc)(sqlite3_context *, int, sqlite3_value **);
|
||||
int nArg;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue