logoalt Hacker News

ueckeryesterday at 10:18 AM1 replyview on HN

Of course, one you have identifies the bounds to each pointer you could just do bounds checking in C.


Replies

AlotOfReadingyesterday at 11:27 AM

That's not actually sufficient in the general case where the pointer may not be the type of the underlying object. You also have to respect strict aliasing even if the bounds are correct. This isn't true in the same way in Rust because memory is untyped. You only need to ensure basic memory validity (range, initialization, alignment, etc).

show 2 replies