Bad array indexing is considered deadly

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 2 05:41:31 PDT 2017


On 6/1/17 3:49 PM, Timon Gehr wrote:
> On 01.06.2017 02:57, Moritz Maxeiner wrote:
>>>
>>> Termination of what? How on earth do you determine that the scope of
>>> this "undefined state" is the program, not the machine, or the world?
>>
>> As that is the closest scope current operating systems give us to work
>> with, this is a sane default for the runtime. Nobody stops you from
>> using a different scope if you need it.
>>
>
> Yes, they would stop me from using a smaller scope. 'nothrow' functions
> are not guaranteed to be unwindable and the compiler infers 'nothrow'
> automatically. Also, null pointer dereferences do not even throw. (On
> Linux.)

By default yes, but...

https://github.com/dlang/druntime/blob/master/src/etc/linux/memoryerror.d

-Steve


More information about the Digitalmars-d mailing list