Bad array indexing is considered deadly
Timon Gehr via Digitalmars-d
digitalmars-d at puremagic.com
Wed May 31 14:29:53 PDT 2017
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.
More information about the Digitalmars-d
mailing list