Typical security issues in C++: why the GC isn't your enemy

Nick Treleaven nick at geany.org
Mon Dec 12 12:57:54 UTC 2022


On Monday, 12 December 2022 at 11:07:00 UTC, Siarhei Siamashka 
wrote:
> Bounds checking is not done in @safe and @trusted code in 
> "-release" builds.

False. Compile this with `-release`:

```d
@safe int main()
{
	auto a = [1];
	return a[1];
}
```

core.exception.ArrayIndexError at safestd.d(4): index [1] is out of 
bounds for array of length 1
----------------
??:? _d_arraybounds_indexp [0x561bc98fb805]
??:? _Dmain [0x561bc98fb75d]



More information about the Digitalmars-d mailing list