Stack frames larger than 4K should be rejected, but what if I want more
IGotD-
nise at nise.com
Mon Jun 28 14:40:12 UTC 2021
On Monday, 28 June 2021 at 14:01:50 UTC, Steven Schveighoffer
wrote:
>
> The point is to ensure the guard page is triggered. This is not
> about the safety of initialized values. It's about making sure
> the stack pointer stays sane. I don't know about you, but I
> don't want to start having to worry about stack pointer
> correctness, even in system code.
>
> This would be like saying null pointer dereferences only
> trigger a segfault in safe code, so now all system code that
> doesn't want to corrupt some mmapped data at the null page must
> first check that a pointer is not null before using. It's
> nonsense.
>
> -Steve
If you want stack overflow safety for whatever reason, then you
should do proper bounds checking for each frame. I consider the
4K limitation and poking stack pages ahead to be just hacks.
More information about the Digitalmars-d
mailing list