1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Deprecate sqlite3_js_vfs_create_file() because, it was discovered today, its out-of-scope use of the sqlite3_vfs, sqlite3_file, and sqlite3_io_methods APIs triggers unresolvable assertions in the core when built with SQLITE_DEBUG.

FossilOrigin-Name: f3647a3ac8eca8c821b0b1e403da7bfb0feabd0eb5ee83709cd4956dfc56a492
This commit is contained in:
stephan
2023-08-11 14:31:20 +00:00
parent 59d01de837
commit 7e13152952
5 changed files with 28 additions and 12 deletions

View File

@ -295,7 +295,7 @@ SQLITE_WASM_EXPORT void * sqlite3_wasm_pstack_ptr(void){
*/
SQLITE_WASM_EXPORT void sqlite3_wasm_pstack_restore(unsigned char * p){
assert(p>=PStack.pBegin && p<=PStack.pEnd && p>=PStack.pPos);
assert(0==(p & 0x7));
assert(0==((unsigned long long)p & 0x7));
if(p>=PStack.pBegin && p<=PStack.pEnd /*&& p>=PStack.pPos*/){
PStack.pPos = p;
}
@ -1395,6 +1395,12 @@ int sqlite3_wasm_vfs_create_file( sqlite3_vfs *pVfs,
const char *zFilename,
const unsigned char * pData,
int nData ){
#ifdef SQLITE_DEBUG
fprintf(stderr,"%s does not work in debug builds because its out-of-scope use of "
"the sqlite3_vfs API triggers assertions in the core library.\n", __func__);
/* ^^^ That was unfortunately not discovered until 2023-08-11. */
return SQLITE_ERROR;
#else
int rc;
sqlite3_file *pFile = 0;
sqlite3_io_methods const *pIo;
@ -1462,6 +1468,7 @@ int sqlite3_wasm_vfs_create_file( sqlite3_vfs *pVfs,
RC;
#undef RC
return rc;
#endif
}
/*