symisc / unqlite

An Embedded NoSQL, Transactional Database Engine
https://unqlite.symisc.net
Other
2.11k stars 164 forks source link

external/unqlite: fix left shift ASAN errors #121

Closed PeterBee97 closed 3 years ago

PeterBee97 commented 3 years ago

when running unqlite with AddressSanitizer check, it shows some error like "left shift of x by y places cannot be represented in type 'int'". This is due to implicit promotion of "unsigned char" to "int" when left-shifting. This patch adds explicit cast of "sxu32" to correct the behavior.

Signed-off-by: Peter Bee bijunda1@xiaomi.com Change-Id: I588266ff7b836dd8dab724713602243c1f91ecd8