Skip to content

Commit 475bd24

Browse files
authored
Suffix BUFFERSIZEs as UL to prevent int overflow in computations
1 parent b70227a commit 475bd24

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

common_power.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -841,17 +841,17 @@ Lmcount$lazy_ptr:
841841
#endif
842842

843843
#if defined(PPC440)
844-
#define BUFFER_SIZE ( 2 << 20)
844+
#define BUFFER_SIZE ( 2UL << 20)
845845
#elif defined(PPC440FP2)
846-
#define BUFFER_SIZE ( 16 << 20)
846+
#define BUFFER_SIZE ( 16UL << 20)
847847
#elif defined(POWER6) || defined(POWER8) || defined(POWER9) || defined(POWER10)
848-
#define BUFFER_SIZE ( 64 << 22)
848+
#define BUFFER_SIZE ( 64UL << 22)
849849
#else
850-
#define BUFFER_SIZE ( 16 << 20)
850+
#define BUFFER_SIZE ( 16UL << 20)
851851
#endif
852852
#ifdef DYNAMIC_ARCH
853853
#undef BUFFER_SIZE
854-
#define BUFFER_SIZE (64 << 22)
854+
#define BUFFER_SIZE (64UL << 22)
855855
#endif
856856

857857
#ifndef PAGESIZE

0 commit comments

Comments
 (0)