News for hackers. Stuff that matters.
Re:Rust via its Core Values by barrkel on Sunday April 03, 2016 @06:20PM (#11418054)
A segfault implies a pointer to an unmapped page in memory. An array out of bounds error isn't the same class of error. The former implies that what pointers can point at isn't constrained; instead of pointing at unmapped page, it could point at the inside of some sensitive data structure (think: web response buffer pointing at database credentials). The latter implies that indirections are checked; this is a very different guarantee.
Re:Rust via its Core Values by bogomipz on Monday April 04, 2016 @06:24AM (#11420696)
Thanks, could you explain the "indirections" in this context? I haven't heard this before.
Re:Rust via its Core Values by barrkel on Monday April 04, 2016 @02:09PM (#11423977)
Array accesses are implicit indirections. The base, index and element size are used to compute the address of a location which is then indirected to store or load. Without range checking, array accesses can be used to read or write arbitrary locations in memory, just like pointers.
Re:Rust via its Core Values by bogomipz on Monday April 04, 2016 @04:10PM (#11425117)
Ah ok right, that makes perfect sense. Thanks.