Exception/Error division in D

deadalnix deadalnix at gmail.com
Wed May 30 15:01:16 PDT 2012


Le 30/05/2012 17:29, Don Clugston a écrit :
> There's a big difference. A segfault is a machine error. The integrity
> of the machine model has been violated, and the machine is in an
> out-of-control state. In particular, the stack may be corrupted, so
> stack unwinding may not be successful.
>
> But, in an assert error, the machine is completely intact; the error is
> at a higher level, which does not interfere with stack unwinding.
>
> Damage is possible only if you've written your destructors/finally code
> extremely poorly. Note that, unlike C++, it's OK to throw a new Error or
> Exception from inside a destructor.
> But with (say) a stack overflow, you don't necessarily know what code is
> being executed. It could do anything.
>

Most segfault are null deference or unintizialized pointer deference. 
Both are recoverable.


More information about the Digitalmars-d mailing list