aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-wasm.c
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-09-11 05:44:15 +0000
committerstephan <stephan@noemail.net>2022-09-11 05:44:15 +0000
commit2a91126d761eb0cc9e4dc01f7e7d9e620178910b (patch)
treef617a176290d54f5c0a02416af0831f17df99a20 /ext/wasm/api/sqlite3-wasm.c
parentade4f4d6454bcaf7b61bb40ab1f80f1b1cfc1f83 (diff)
downloadsqlite-2a91126d761eb0cc9e4dc01f7e7d9e620178910b.tar.gz
sqlite-2a91126d761eb0cc9e4dc01f7e7d9e620178910b.zip
Correct the result code from kvstorageRead() for the OOM case to be a negative value.
FossilOrigin-Name: cdbf09fa1b0c93aeb3222a157de33a4688ae629c2b829ffff0f1f62364c5ae1c
Diffstat (limited to 'ext/wasm/api/sqlite3-wasm.c')
-rw-r--r--ext/wasm/api/sqlite3-wasm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/wasm/api/sqlite3-wasm.c b/ext/wasm/api/sqlite3-wasm.c
index 8e382e7f5..e2f1576c6 100644
--- a/ext/wasm/api/sqlite3-wasm.c
+++ b/ext/wasm/api/sqlite3-wasm.c
@@ -641,7 +641,7 @@ EM_JS(int, kvstorageRead,
const stack = stackSave();
try {
const zXKey = kvstorageMakeKeyOnJSStack(zClass,zKey);
- if(!zXKey) return 1/*OOM*/;
+ if(!zXKey) return -3/*OOM*/;
const jKey = UTF8ToString(zXKey);
const jV = ((115/*=='s'*/===getValue(zClass))
? sessionStorage : localStorage).getItem(jKey);
@@ -661,7 +661,7 @@ EM_JS(int, kvstorageRead,
return nBuf - 1;
}catch(e){
console.error("kvstorageRead()",e);
- return -1;
+ return -2;
}finally{
stackRestore(stack);
}