forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When making the method constexpr and calling it, the compiler generates the following error if you call raw_ptr -= 1u; "Cannot refer to element 4294967296 of array of 3 elements in a constant expression" Negating a size_t variable is not what we want to do here, as that produces an index out of bounds. Add a Retreat() method to raw_ptr implementations to avoid trying to negate, as that can produce overflow with both a signed or unsigned input. This also requires a parameter to PartitionAlloc's IsValidDelta paths, to say whether the delta should be added or subtracted from the original pointer. This does avoid any CHECKs for invalid negations. Change-Id: I9ee8650e9658fae113d0d42b8cc8f2af7e077e48 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4284957 Reviewed-by: Bartek Nowierski <bartekn@chromium.org> Commit-Queue: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/main@{#1112433}
- Loading branch information
Showing
10 changed files
with
246 additions
and
239 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
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
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
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
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
Oops, something went wrong.