Some bounds checks are elided by Apple's compiler and possibly others
https://github.com/capnproto/capnproto/blob/master/security-advisories/2017-04-17-0-apple-clang-elides-bounds-check.md [github.com]
2018-03-22 16:45
Although triggered by a compiler optimization, this is a bug in Cap’n Proto, not the compiler.
To most observers, this code would appear to be correct. However, as it turns out, pointer arithmetic that overflows is undefined behavior under the C standard. As a result, the compiler is allowed to assume that the addition on the first line never overflows.
source: danluu