Better diagnostics for null classes dereferencing

Steven Schveighoffer schveiguy at yahoo.com
Tue Jul 10 19:27:07 UTC 2018


On 7/10/18 3:01 PM, Per Nordlöw wrote:
> Is it possible to change run-time behaviour of null-class dereferencing, 
> on Linux, so that it gives some other diagnostics than:
> 
> Program exited with code -11
> 
> Does DMD and LDC provide different alternatives here?

Yes, call this function on startup:

import etc.linux :  registerMemoryErrorHandler;

void main()
{
     registerMemoryErrorHandler();
     ...
}

No, it's not documented anywhere. Probably should be...

-Steve


More information about the Digitalmars-d-learn mailing list