-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle more corner cases for textrange endpoints node deletion
Previous CLs (crrev.com/c/3331356, crrev.com/c/3293769) missed a couple of cases: - Due to how we handle parent positions, the leaf tree position after normalization could end up being ignored. If that is the case, the position will be moved forward, leaving us in the case where start > end. In those cases, we left start pointing at end, which could be a pointer to a soon-to-be-deleted node. Instead, we now move the degenerate range to a position we know will not be deleted. - In trees where the ancestor chain of the deleted subtree is completely ignored, we might not find a parent position (or at least normalizing to unignored might put us back in the unignored subtree to be deleted). In these cases, make sure we end up with a null position so we don't have a dangling pointer. One other performance-related fix to the previous code: we should use a cheaper mechanism to say which nodes we care about. In the common case, deleted subtrees won't affect a given text range so do a node- based walk instead of trying to create the parent/ancestor positions up-front. This CL also removes the DumpWithoutCrashing since its location is a bit late to understand what operations led to the conditions where it currently fires. (cherry picked from commit 8b2eacc) Bug: 1278304, 1265638 Change-Id: I1aa318e54f9f9b4c8a1b13f71f6fdc678e510f39 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3351043 Commit-Queue: Daniel Libby <dlibby@microsoft.com> Reviewed-by: Jacques Newman <janewman@microsoft.com> Cr-Original-Commit-Position: refs/heads/main@{#953289} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3453248 Reviewed-by: Srinivas Sista <srinivassista@chromium.org> Commit-Queue: Srinivas Sista <srinivassista@chromium.org> Owners-Override: Srinivas Sista <srinivassista@chromium.org> Cr-Commit-Position: refs/branch-heads/4758@{#1143} Cr-Branched-From: 4a2cf4b-refs/heads/main@{#950365}
- Loading branch information
Showing
4 changed files
with
298 additions
and
13 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