aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-wasm.c
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-12-25 14:13:52 +0000
committerstephan <stephan@noemail.net>2022-12-25 14:13:52 +0000
commit04071524ae6e4e86a1c670a9432b016b40889100 (patch)
tree87dd2dbdceb356b962846e42418fdae44266dfda /ext/wasm/api/sqlite3-wasm.c
parentbb769f0b4a025761fa2f5150582cf7736cb14345 (diff)
parent7015aa9f4957c3131c8bc814c81c4c5d2dea8f89 (diff)
downloadsqlite-04071524ae6e4e86a1c670a9432b016b40889100.tar.gz
sqlite-04071524ae6e4e86a1c670a9432b016b40889100.zip
Merge trunk into wasm-session-api branch.
FossilOrigin-Name: 7f8f1acd82be7dc2eb2147d96299b1b443e86774dfe0b0a8d32669a0500fc9c6
Diffstat (limited to 'ext/wasm/api/sqlite3-wasm.c')
-rw-r--r--ext/wasm/api/sqlite3-wasm.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/ext/wasm/api/sqlite3-wasm.c b/ext/wasm/api/sqlite3-wasm.c
index 3f0d40e5c..b39e252b1 100644
--- a/ext/wasm/api/sqlite3-wasm.c
+++ b/ext/wasm/api/sqlite3-wasm.c
@@ -329,11 +329,13 @@ SQLITE_WASM_KEEP int sqlite3_wasm_pstack_quota(void){
*/
SQLITE_WASM_KEEP
int sqlite3_wasm_db_error(sqlite3*db, int err_code, const char *zMsg){
- if( 0!=zMsg ){
- const int nMsg = sqlite3Strlen30(zMsg);
- sqlite3ErrorWithMsg(db, err_code, "%.*s", nMsg, zMsg);
- }else{
- sqlite3ErrorWithMsg(db, err_code, NULL);
+ if( db!=0 ){
+ if( 0!=zMsg ){
+ const int nMsg = sqlite3Strlen30(zMsg);
+ sqlite3ErrorWithMsg(db, err_code, "%.*s", nMsg, zMsg);
+ }else{
+ sqlite3ErrorWithMsg(db, err_code, NULL);
+ }
}
return err_code;
}
@@ -1649,6 +1651,11 @@ int sqlite3_wasm_test_intptr(int * p){
}
SQLITE_WASM_KEEP
+void * sqlite3_wasm_test_voidptr(void * p){
+ return p;
+}
+
+SQLITE_WASM_KEEP
int64_t sqlite3_wasm_test_int64_max(void){
return (int64_t)0x7fffffffffffffff;
}