logoalt Hacker News

mbrockyesterday at 11:47 AM1 replyview on HN

Fil-C's understanding of memory safety is not "its own" idiosyncratic made up definition. Memory safety in the whole tradition that includes CHERI etc is defined in terms of objects and allocations. In C structs and arrays are not object boundaries. So CHERI will have the same semantics as Fil-C in your struct example, unless you enable a compatibility-breaking mode, which Fil-C could very plausibly acquire too, at the same cost of breaking semantic compatibility with the C/C++ semantics.


Replies

steveklabnikyesterday at 3:56 PM

C absolutely has struct, array, and subobject boundaries. The example is already undefined behavior in C.

show 1 reply