Hacker News new | ask | show | jobs
by andhow 4444 days ago
On x64 in Firefox, at least, there are no bounds checks; the index is a uint32; the entire accessible 4GB range is mapped PROT_NONE with only the accessible region mapped PROT_READ|PROT_WRITE; out-of-bounds accesses thus reliably turn into SIGSEGVs which are handled safely after which execution resumes. Thus, bounds checking is effectively performed by the MMU.
1 comments

Interesting approach, might have to look at the code. Nonetheless it highlights how useful the MMU is and how none of this is free.