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

Correct the result code from kvstorageRead() for the OOM case to be a negative value.

FossilOrigin-Name: cdbf09fa1b0c93aeb3222a157de33a4688ae629c2b829ffff0f1f62364c5ae1c
This commit is contained in:
stephan
2022-09-11 05:44:15 +00:00
parent ade4f4d645
commit 2a91126d76
3 changed files with 9 additions and 9 deletions

View File

@ -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);
}