harmful null dereference straight in dmd

Sean Kelly sean at invisibleduck.org
Sat Mar 7 08:36:40 PST 2009


Andrei Alexandrescu wrote:
> In what could be a supremely ironic turn, dmd has a null dereference 
> error that leaves me in the dust. I have to compile a largish D2 app 
> that last compiled in 2007. I was thinking all I have to do is fix the 
> language and compiler changes, which is what I was doing, until a point 
> where dmd unceremoniously aborts compilation with:
> 
> Segmentation fault
> 
> This looks like a null dereference, and is the fourth time I am seeing 
> compilers errors that don't mention file and line. Rule #1 of compiler 
> writing should be, whenever you fail for whatever reason, inform the 
> user about where you were. Trying to do forensics without such vital 
> information wastes hours like minutes.
> 
> If there was a need to convince me that null dereference can be harmful, 
> this situation drove the point home in a rather painful way.

That's nasty.  And it reminds me that I really need to try and figure 
out if file/line info can be reported for a segfault.  Though I guess 
the larger issue is whether D should have a non-null attribute :-)



More information about the Digitalmars-d mailing list