add -gx to add stack smash code

Walter Bright newshound2 at digitalmars.com
Wed Jan 23 21:32:51 PST 2013


https://github.com/D-Programming-Language/dmd/pull/1542

I haven't noticed any other compiler with this feature. What it does is upon 
function exit, it 'smashes' all the memory used for local variables. The idea is 
to flush out any dependencies on the now-out-of-scope stack frame.

Throw this switch when you are experiencing bizarre crashes that come and go - 
it may help find the root of the problem by causing it to fail sooner and more 
predictably.

It may also be handy if, for crypto code, you don't want to leave passwords 
around in memory, though I'd be more proactive about that than relying on this.


More information about the Digitalmars-d-announce mailing list