Fix another UBSAN error

fdbserver/sqlite/sqlite3.amalgamation.c:14709:15: runtime error: left shift of 205 by 24 places cannot be represented in type 'int'
This commit is contained in:
Andrew Noyes 2019-11-27 18:05:41 -08:00
parent 36e9f40fc2
commit b086dbecac

View File

@ -14706,7 +14706,7 @@ SQLITE_PRIVATE int sqlite3VarintLen(u64 v){
** Read or write a four-byte big-endian integer value.
*/
SQLITE_PRIVATE u32 sqlite3Get4byte(const u8 *p){
return (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
return ((u32)p[0]<<24) | ((u32)p[1]<<16) | ((u32)p[2]<<8) | (u32)p[3];
}
SQLITE_PRIVATE void sqlite3Put4byte(unsigned char *p, u32 v){
p[0] = (u8)(v>>24);