-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The iterator constructor used `array[index]` to initialize an internal cached view (necessary so that `operator->` can return a pointer), which caused pointer arithmetic overflow when `index` was -1 -- as in the case of `rend()`. This change uses a checked `array.at(index)` method to get a null view when `index` is out of bounds. I considered changing `array[index]` to return a null view for out-of-bounds indexes, but user code may be inadvertently relying on that behavior, so I am leaving it out of this bug fix.
- Loading branch information
Showing
1 changed file
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters