www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Add pragma(stackStomp, [true|false]) to control -gx on per-function

reply Walter Bright <newshound2 digitalmars.com> writes:
Stomping the stack is important for detecting certain kinds of dangling 
reference bugs (shouldn't be possible in  safe code), but also for
code that aims to prevent a function from leaking any information to its caller:


This should be controllable on a per-function basis, and the best way is 
analogous to the way the `pragma(inline)` works, i.e.:

   pragma(stackStomp) // default, meaning set to the setting of the -gx switch
   pragma(stackStomp, true)  // enable for this function
   pragma(stackStomp, false)  // disable for this function



The stomp code should also be improved to overwrite all scratch registers 
modified by the function that are not part of the return value or the registers 
already preserved by the function.0
Apr 24 2018
parent Walter Bright <newshound2 digitalmars.com> writes:
Apr 24 2018