Merge pull request #4796 from martin-frbg/ppcbuf

Suffix BUFFER_SIZEs on POWER as UL to prevent int overflow in computations
This commit is contained in:
Martin Kroeker
2024-07-12 11:06:45 +02:00
committed by GitHub

View File

@@ -841,17 +841,17 @@ Lmcount$lazy_ptr:
#endif
#if defined(PPC440)
#define BUFFER_SIZE ( 2 << 20)
#define BUFFER_SIZE ( 2UL << 20)
#elif defined(PPC440FP2)
#define BUFFER_SIZE ( 16 << 20)
#define BUFFER_SIZE ( 16UL << 20)
#elif defined(POWER6) || defined(POWER8) || defined(POWER9) || defined(POWER10)
#define BUFFER_SIZE ( 64 << 22)
#define BUFFER_SIZE ( 64UL << 22)
#else
#define BUFFER_SIZE ( 16 << 20)
#define BUFFER_SIZE ( 16UL << 20)
#endif
#ifdef DYNAMIC_ARCH
#undef BUFFER_SIZE
#define BUFFER_SIZE (64 << 22)
#define BUFFER_SIZE (64UL << 22)
#endif
#ifndef PAGESIZE