From 2a91126d761eb0cc9e4dc01f7e7d9e620178910b Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 11 Sep 2022 05:44:15 +0000 Subject: Correct the result code from kvstorageRead() for the OOM case to be a negative value. FossilOrigin-Name: cdbf09fa1b0c93aeb3222a157de33a4688ae629c2b829ffff0f1f62364c5ae1c --- ext/wasm/api/sqlite3-wasm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/wasm/api/sqlite3-wasm.c') 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); } -- cgit v1.2.3