Program logic bugs vs input/environmental errors

via Digitalmars-d digitalmars-d at puremagic.com
Wed Nov 12 12:52:26 PST 2014


On Wednesday, 12 November 2014 at 20:40:45 UTC, Walter Bright 
wrote:
> Forgive me for being snarky, but there are text editing 
> utilities where one can:

Snarky is ok. :)

> In any case, compiler switches should not change behavior like 
> that. assert() and enforce() are completely different.

Well, but I don't understand how assert() can unwind the stack if 
everyone should assume that the stack might be trashed and 
therefore invalid?

In order to be consistent it with your line of reasoning it 
should simply HLT, then a SIGSEGV handler should set up a 
preallocated stack, obtain the information and send it off to a 
logging service using pure system calls before terminating (or 
send it to the parent process).



More information about the Digitalmars-d mailing list