April 26, 2024, 10:03:02 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Found a bug

Started by Parker, December 10, 2005, 05:44:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Parker

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.

Ionic Wind Support Team

Yep.  Already ran into that one and fixed it.

Thanks,
Paul.
Ionic Wind Support Team