ruby: fixed Set.cc bug to allow zero sized sets

This is necessary for example when no dma sequencers are necessary in the
simulated system.
This commit is contained in:
Brad Beckmann 2010-01-29 20:29:21 -08:00
parent ce2d13195b
commit 020716cab3

View file

@ -69,9 +69,12 @@ Set::Set(const Set& obj) {
Set::Set(int size) Set::Set(int size)
{ {
m_p_nArray = NULL; m_p_nArray = NULL;
assert(size>0); m_nArrayLen = 0;
m_nSize = 0;
if(size > 0) {
setSize(size); setSize(size);
} }
}
Set::~Set() { Set::~Set() {
if( (m_p_nArray != (&m_p_nArray_Static[0])) && (m_p_nArray != NULL)) if( (m_p_nArray != (&m_p_nArray_Static[0])) && (m_p_nArray != NULL))