Fix build failure in gold due to signed vs. unsigned comparisons.
authorCary Coutant <ccoutant@gmail.com>
Sat, 6 Feb 2016 17:53:58 +0000 (09:53 -0800)
committerCary Coutant <ccoutant@gmail.com>
Sat, 6 Feb 2016 17:53:58 +0000 (09:53 -0800)
* reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
comparison.
(Bits::has_unsigned_overflow): Likewise.

gold/ChangeLog
gold/reloc.h

index c883077e445a249f85fbe4cd9d95aaf37b01ea99..1b363743f4c62db28f9f030b5987a071f6f9eb14 100644 (file)
@@ -1,3 +1,9 @@
+2016-02-06  Cary Coutant  <ccoutant@gmail.com>
+
+       * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
+       comparison.
+       (Bits::has_unsigned_overflow): Likewise.
+
 2016-02-06  Marcin Koƛcielnicki  <koriakin@0x04.net>
 
        * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
index 4f1e753bf99c36e9c7bd1a271aaeaf92535bc036..fce73136375465e10eb8fec1ef97a31365f40a0a 100644 (file)
@@ -1015,7 +1015,7 @@ class Bits
     gold_assert(bits > 0 && bits <= 32);
     if (bits == 32)
       return false;
-    int32_t max = static_cast<int32_t>((1U << bits) - 1);
+    uint32_t max = static_cast<int32_t>((1U << bits) - 1);
     return val > max;
   }
 
@@ -1081,7 +1081,7 @@ class Bits
     gold_assert(bits > 0 && bits <= 64);
     if (bits == 64)
       return false;
-    int64_t max = static_cast<int64_t>((static_cast<uint64_t>(1) << bits) - 1);
+    uint64_t max = static_cast<int64_t>((static_cast<uint64_t>(1) << bits) - 1);
     return val > max;
   }