Open Bug 1445260 Opened 7 years ago Updated 2 years ago

add release-mode bounds checking to Vector::operator[] et al and associated iterators

Categories

(Core :: MFBT, enhancement)

enhancement

Tracking

()

Tracking Status
firefox61 --- affected

People

(Reporter: froydnj, Unassigned)

Details

We did this for nsTArray in bug 1159244 (and others) and it caught a number of errors. Rust has this by default and we can too. Note that there probably *does* need to be a fallback to do unchecked accesses, for code that absolutely, positively, always does in-bounds accesses and simply cannot afford the extra checks. But said fallback should be somewhat loud and obnoxious to make it obvious what's going on and to discourage casual use. It may be simpler to just add release-mode bounds checking for operator[] and then extend the release-mode bounds checking to other functions and iterators in separate bugs.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.