Great example of out-of-bounds array/struct access being exploited for optimisation by gcc:
miniblog.
Related Posts
Some excellent safety improvements in C++26: hardening the standard library against out-of-bounds bugs, and a safer semantics for uninitialised local variables:
Benchmarking the cost of array bounds checks in Rust code: https://blog.readyset.io/bounds-checks/
The author even patches rustc to make sure *all* bounds checks are gone, in order to compare the performance!
Rust 1.34.0 had a security vulnerability that allowed reading/writing memory out of bounds!
