Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6aa081b

Browse files
authored
Merge pull request #242 from visitorckw/fix-signed-integer-overflow
Fix signed integer overflow by casting to uint32_t
2 parents 23622ee + 03e346d commit 6aa081b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/uTensor/allocators/arenaAllocator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace uTensor {
1414

1515
//#define MSB_SET ~( ~( (T)0 ) >> 1 )
16-
#define MSB_SET (1 << (sizeof(uint32_t) * 8 - 1))
16+
#define MSB_SET ((uint32_t)1 << (sizeof(uint32_t) * 8 - 1))
1717
#define BLOCK_INACTIVE ~MSB_SET
1818
#define BLOCK_LENGTH_MASK ~MSB_SET
1919
#define BLOCK_ACTIVE MSB_SET

0 commit comments

Comments
 (0)