Making alloca more safe

grauzone none at example.net
Mon Nov 16 12:59:55 PST 2009


Walter Bright wrote:
> dsimcha wrote:
>> In a way you're right.  However, there is no universal answer for what 
>> to do about
>> a null pointer except die **with a good error message explaining what 
>> went
>> wrong**.  This is the part that's missing.  Right now you get an 
>> access violation.
>>  I'd like an assert failure with a line number and a "Null pointer 
>> dereference"
>> error message when I'm not in release mode.
> 
> You do get just that if you run the program under a debugger.
> 
> There was a patch for Phobos a while back which would use the debug data 
> to print a stack trace on such an exception without needing a debugger. 
> It has languished because nobody has spent the time to verify that it is 
> correctly done and that it won't negatively impact anything else. I can 
> forward it to you if you like and want to take a look at it.

It's in Tango and it works. Both on Linux and Windows.
(Needs the Tango svn version.)



More information about the Digitalmars-d mailing list