Ruby NetDest: add assert for bad element in netdest
authorJason Power <powerjg@cs.wisc.edu>
Wed, 1 Aug 2012 22:07:34 +0000 (17:07 -0500)
committerJason Power <powerjg@cs.wisc.edu>
Wed, 1 Aug 2012 22:07:34 +0000 (17:07 -0500)
src/mem/ruby/common/NetDest.cc

index 2d070d33d1435257cdb1fe114529bcd026e15347..97788345ceb5ebab66bc788c7b93542ccf0a16f0 100644 (file)
@@ -38,6 +38,7 @@ NetDest::NetDest()
 void
 NetDest::add(MachineID newElement)
 {
+    assert(bitIndex(newElement.num) < m_bits[vecIndex(newElement)].getSize());
     m_bits[vecIndex(newElement)].add(bitIndex(newElement.num));
 }