www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Re: Memory corruption rant.

reply Kagamin <spam here.lot> writes:
Jesse Phillips Wrote:

 writeln("I'm still ok");
 writeln("2");
 if(myObject is null)
   writeln("3");
 else
   writeln("4");
 writeln(0);
 writeln(false);

 Prints everything up to 2.

You should look at it in debugger at assembly level. There's no need to compile it with debug symbols, they'll be of no use for you. I suspect EBP==0.
Jun 02 2011
parent Kagamin <spam here.lot> writes:
Kagamin Wrote:

 Jesse Phillips Wrote:
 
 writeln("I'm still ok");
 writeln("2");
 if(myObject is null)
   writeln("3");
 else
   writeln("4");
 writeln(0);
 writeln(false);

 Prints everything up to 2.

You should look at it in debugger at assembly level. There's no need to compile it with debug symbols, they'll be of no use for you. I suspect EBP==0.

writeln("I'm still ok"); asm { cmp EBP,0; ja ok; hlt; ok: nop; } writeln("Still ok"); if(myObject is null) writeln("3"); else writeln("4");
Jun 02 2011