Skip to content

Commit 6013b36

Browse files
authored
Merge pull request #4796 from martin-frbg/ppcbuf
Suffix BUFFER_SIZEs on POWER as UL to prevent int overflow in computations
2 parents 5d08ec7 + 9789034 commit 6013b36

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)