mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-09 14:21:03 +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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user