fix for sanitizer errors in left shifts

The modified lines cause "runtime error: left shift of <X> by <Y>
places cannot be represented in type 'int'", because integer
literal is cast to int by default.

Change-Id: Ie38119b5eb46ee470e0d149959e523b48ac4d66d
Signed-off-by: Mete Balci <metebalci@gmail.com>
Reviewed-on: http://openocd.zylin.com/5005
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
Mete Balci
2019-03-30 12:51:03 +01:00
committed by Tomas Vanek
parent d5936dc688
commit 5b263d7b0c
3 changed files with 3 additions and 3 deletions

View File

@@ -118,7 +118,7 @@ static inline uint32_t buf_get_u32(const uint8_t *_buffer,
uint32_t result = 0;
for (unsigned i = first; i < first + num; i++) {
if (((buffer[i / 8] >> (i % 8)) & 1) == 1)
result |= 1 << (i - first);
result |= 1U << (i - first);
}
return result;
}