Browse Source

Suffix BUFFERSIZEs as UL to prevent int overflow in computations

tags/v0.3.28^2
Martin Kroeker GitHub 1 year ago
parent
commit
475bd2452b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      common_power.h

+ 5
- 5
common_power.h 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


Loading…
Cancel
Save