summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Kwan <dougkwan@google.com>2009-06-04 01:31:01 +0000
committerDoug Kwan <dougkwan@google.com>2009-06-04 01:31:01 +0000
commit8edcdd92470259da70ad7774a8825e5241e8c92a (patch)
tree1f0092300b707940925d0e4bc313f293f201e29f
parent39e788f93099992067d9b607ad62ff855ccdf680 (diff)
downloadbinutils-redhat-8edcdd92470259da70ad7774a8825e5241e8c92a.tar.gz
2009-06-03 Doug Kwan <dougkwan@google.com>
* arm.cc (utils::sign_extend): Reverse test in gold_assert. (utils::has_overflow): Same.
-rw-r--r--gold/ChangeLog5
-rw-r--r--gold/arm.cc4
2 files changed, 7 insertions, 2 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 7408ac61a6..8f42e6ae7b 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-03 Doug Kwan <dougkwan@google.com>
+
+ * arm.cc (utils::sign_extend): Reverse test in gold_assert.
+ (utils::has_overflow): Same.
+
2009-06-03 Ian Lance Taylor <iant@google.com>
* layout.cc (Layout::section_name_mapping): New array, replacing
diff --git a/gold/arm.cc b/gold/arm.cc
index 5165a5220d..76538de789 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -97,7 +97,7 @@ namespace utils
static inline int32_t
sign_extend(uint32_t bits)
{
- gold_assert(no_bits < 1 || no_bits > 32);
+ gold_assert(no_bits >= 0 && no_bits <= 32);
if (no_bits == 32)
return static_cast<int32_t>(bits);
uint32_t mask = (~((uint32_t) 0)) >> (32 - no_bits);
@@ -112,7 +112,7 @@ namespace utils
static inline bool
has_overflow(uint32_t bits)
{
- gold_assert(no_bits < 1 || no_bits > 32);
+ gold_assert(no_bits >= 0 && no_bits <= 32);
if (no_bits == 32)
return false;
int32_t max = (1 << (no_bits - 1)) - 1;