From: Andreas Hansson Date: Fri, 19 Sep 2014 14:35:07 +0000 (-0400) Subject: misc: Remove assertions ensuring unsigned values >= 0 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f615c4aeb097010eb782a1ee556f990b84757175;p=gem5.git misc: Remove assertions ensuring unsigned values >= 0 --- diff --git a/src/base/chunk_generator.hh b/src/base/chunk_generator.hh index bc71a0569..cf303f693 100644 --- a/src/base/chunk_generator.hh +++ b/src/base/chunk_generator.hh @@ -83,7 +83,6 @@ class ChunkGenerator { // chunkSize must be a power of two assert(chunkSize == 0 || isPowerOf2(chunkSize)); - assert(totalSize >= 0); // set up initial chunk. curAddr = startAddr; diff --git a/src/base/statistics.hh b/src/base/statistics.hh index 8d6644284..7e5f1f5b9 100644 --- a/src/base/statistics.hh +++ b/src/base/statistics.hh @@ -1567,7 +1567,7 @@ class HistStor size_type index = (int64_t)std::floor((val - min_bucket) / bucket_size); - assert(index >= 0 && index < size()); + assert(index < size()); cvec[index] += number; sum += val * number; diff --git a/src/base/vnc/vncserver.cc b/src/base/vnc/vncserver.cc index d11308875..e762ad1d4 100644 --- a/src/base/vnc/vncserver.cc +++ b/src/base/vnc/vncserver.cc @@ -593,8 +593,8 @@ VncServer::recvCutText() size_t bytes_to_read = data_len > 1024 ? 1024 : data_len; len = read((uint8_t*)&str, bytes_to_read); str[bytes_to_read] = 0; + assert(len >= data_len); data_len -= len; - assert(data_len >= 0); DPRINTF(VNC, "Buffer: %s\n", str); } diff --git a/src/mem/cache/tags/base_set_assoc.cc b/src/mem/cache/tags/base_set_assoc.cc index 0d955255a..bb0c20141 100644 --- a/src/mem/cache/tags/base_set_assoc.cc +++ b/src/mem/cache/tags/base_set_assoc.cc @@ -181,8 +181,8 @@ BaseSetAssoc::computeStats() if (blks[i].isValid()) { assert(blks[i].task_id < ContextSwitchTaskId::NumTaskId); occupanciesTaskId[blks[i].task_id]++; + assert(blks[i].tickInserted <= curTick()); Tick age = curTick() - blks[i].tickInserted; - assert(age >= 0); int age_index; if (age / SimClock::Int::us < 10) { // <10us