1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Fix two potential (and apparently harmless) shift overflows discovered by

the -fcatch-undefined-behavior option of clang.

FossilOrigin-Name: e19eead8c9977ed4f00eac54c5bc7e90db78caa8
This commit is contained in:
drh
2013-12-05 16:41:55 +00:00
parent 7f59475fda
commit 47676fedf6
4 changed files with 12 additions and 10 deletions

View File

@@ -4081,7 +4081,7 @@ static int unixShmSystemLock(
#ifdef SQLITE_DEBUG
{ u16 mask;
OSTRACE(("SHM-LOCK "));
mask = (1<<(ofst+n)) - (1<<ofst);
mask = ofst>31 ? 0xffffffff : (1<<(ofst+n)) - (1<<ofst);
if( rc==SQLITE_OK ){
if( lockType==F_UNLCK ){
OSTRACE(("unlock %d ok", ofst));