M
Min
CFool
{
public:
void StartWorldWarIII() { /*** Launch Nuclear Missiles **/ }
};
int main()
{
CFool* pFool = new CFool();
delete pFool;
//////******* const unsigned int GARBAGE = 0xA3;
///// ******* memset( pFoo, GARBAGE , sizeof( CFool) );
pFool->StartWorldWarIII();
return 0;
}
Among other techniques from Writing Solid Code by Steve Maguire, I tried to
scramble the content by filling garbages ( the commented lines ). But it
does not guarantee that "pFoo->StartWorldWarIII()" will crash, but the
object will output garbage, the next time it is used. (an obvious attempt
to indicate that the instance has been deleted.)
Anyway, Anybody knows any trick or technique to guarantee
"pFoo->StartWorldWarIII()" will crash ? for debugging purpose.
(I have a feeling that I am asking it in a wrong NG, but what the heck.)
TIA
{
public:
void StartWorldWarIII() { /*** Launch Nuclear Missiles **/ }
};
int main()
{
CFool* pFool = new CFool();
delete pFool;
//////******* const unsigned int GARBAGE = 0xA3;
///// ******* memset( pFoo, GARBAGE , sizeof( CFool) );
pFool->StartWorldWarIII();
return 0;
}
Among other techniques from Writing Solid Code by Steve Maguire, I tried to
scramble the content by filling garbages ( the commented lines ). But it
does not guarantee that "pFoo->StartWorldWarIII()" will crash, but the
object will output garbage, the next time it is used. (an obvious attempt
to indicate that the instance has been deleted.)
Anyway, Anybody knows any trick or technique to guarantee
"pFoo->StartWorldWarIII()" will crash ? for debugging purpose.
(I have a feeling that I am asking it in a wrong NG, but what the heck.)
TIA