aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/os_unix.c2
-rw-r--r--src/util.c4
2 files changed, 4 insertions, 2 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));
diff --git a/src/util.c b/src/util.c
index e59f5238f..9fa2a0fbd 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1281,6 +1281,8 @@ u64 sqlite3LogEstToInt(LogEst x){
x /= 10;
if( n>=5 ) n -= 2;
else if( n>=1 ) n -= 1;
- if( x>=3 ) return (n+8)<<(x-3);
+ if( x>=3 ){
+ return x>60 ? (u64)LARGEST_INT64 : (n+8)<<(x-3);
+ }
return (n+8)>>(3-x);
}