diff options
author | drh <drh@noemail.net> | 2013-12-05 16:41:55 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2013-12-05 16:41:55 +0000 |
commit | 47676fedf640e2433bde647a6c3343fa2e3a64c0 (patch) | |
tree | 4032029cbffd4e3403b72d06fc376a2c027af80c /src/os_unix.c | |
parent | 7f59475fdaac1f487f32cc3604b15a7273b73631 (diff) | |
download | sqlite-47676fedf640e2433bde647a6c3343fa2e3a64c0.tar.gz sqlite-47676fedf640e2433bde647a6c3343fa2e3a64c0.zip |
Fix two potential (and apparently harmless) shift overflows discovered by
the -fcatch-undefined-behavior option of clang.
FossilOrigin-Name: e19eead8c9977ed4f00eac54c5bc7e90db78caa8
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 501b1b769..ab657dc7b 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -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)); |