diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2015-04-29 22:35:22 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2015-04-29 22:35:22 -0500 |
commit | 3a2731fb8cb0bcb152979fb41ba23ce2b981444f (patch) | |
tree | 250b1ca20fbf7459250388afda8b4242b0b87e12 /src/mem/ruby/common/Set.hh | |
parent | 43335495754abac71377bbd6df0c668b60b22822 (diff) | |
download | gem5-3a2731fb8cb0bcb152979fb41ba23ce2b981444f.tar.xz |
ruby: set: replace long by unsigned long
UBSan complains about negative value being shifted
Diffstat (limited to 'src/mem/ruby/common/Set.hh')
-rw-r--r-- | src/mem/ruby/common/Set.hh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mem/ruby/common/Set.hh b/src/mem/ruby/common/Set.hh index bedd44aa6..e97385e5e 100644 --- a/src/mem/ruby/common/Set.hh +++ b/src/mem/ruby/common/Set.hh @@ -62,10 +62,12 @@ class Set // 64 bits if the -m64 parameter is passed to g++, which it is // for an AMD opteron under our configuration - long *m_p_nArray; // an word array to hold the bits in the set - long m_p_nArray_Static[NUMBER_WORDS_PER_SET]; + // an word array to hold the bits in the set + unsigned long *m_p_nArray; + unsigned long m_p_nArray_Static[NUMBER_WORDS_PER_SET]; - static const int LONG_BITS = std::numeric_limits<long>::digits + 1; + static const int LONG_BITS = + std::numeric_limits<unsigned long>::digits + 1; static const int INDEX_SHIFT = LONG_BITS == 64 ? 6 : 5; static const int INDEX_MASK = (1 << INDEX_SHIFT) - 1; |