Bad array indexing is considered deadly

Moritz Maxeiner via Digitalmars-d digitalmars-d at puremagic.com
Wed May 31 15:22:20 PDT 2017


On Wednesday, 31 May 2017 at 21:29:53 UTC, Timon Gehr wrote:
> On 31.05.2017 22:45, Moritz Maxeiner wrote:
>> On Wednesday, 31 May 2017 at 20:09:16 UTC, Nick Sabalausky 
>> (Abscissa) wrote:
>>> [...]
>>>> program is in an undefined state and should terminate asap.
>>>
>>> Then out-of-bounds and assert failures should be Exception 
>>> not Error. Frankly, even out-of-memory, arguably. And then 
>>> there's null dereference... In other words, basically 
>>> everything.
>> 
>> No, because as I stated in my other post, the runtime *cannot* 
>> assume that it is safe *in all cases*. If there is even one 
>> single case in which it is unsafe, it must abort.
>
> Hence all programs must abort on startup.

In the context of the conversation, and error has already 
occurred and the all cases was referring to all the cases that 
lead to the error.


More information about the Digitalmars-d mailing list