IonicWind Software

Aurora Compiler => General Discussion => Topic started by: Parker on December 10, 2005, 05:44:59 PM

Title: Found a bug
Post by: Parker on December 10, 2005, 05:44:59 PM
I know, it's invalid code, but the compiler crashes on it instead of issuing an error.
I have a structure, DictNode, defined as the following:
struct DictNode
{
pointer key;
pointer value;
}


Then in a function, I have the code:
Dictionary::Get(string key)
{
pointer pList, pNode;
DictNode *pData;
string *pKey;
pList = m_pLists + (Hash(key) * len(listnode));
pNode = ListGetFirst(pList);
while (pNode <> 0)
{
pData = ListGetData(pNode);
pKey = *pData.pKey; // This is the offending line
if (*pKey = key) break;
pNode = ListGetNext(pNode);
}

return *(DictNode)pData.value;
}

I've fixed the code to say just "*pData.key" and it works now, but I just thought the compiler shouldn't crash on this.

Thanks,
Parker.
Title: Re: Found a bug
Post by: Ionic Wind Support Team on December 10, 2005, 08:14:12 PM
Yep.  Already ran into that one and fixed it.

Thanks,
Paul.