Skip to content

Commit bbc257c

Browse files
authored
Merge pull request #2850 from apple/eng/fix-ref-2021
[clang-refactor] Fix an issue where an out of bounds NodeTree access …
2 parents be38d4f + a616631 commit bbc257c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Tooling/Refactor/ASTSlice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ canonicalizeSelectedExpr(const Stmt *S, unsigned Index,
261261

262262
// Look through the implicit casts in the parents.
263263
unsigned ParentIndex = Index + 1;
264-
for (; ParentIndex <= NodeTree.size() && isa<ImplicitCastExpr>(Parent);
264+
for (; (ParentIndex + 1) < NodeTree.size() && isa<ImplicitCastExpr>(Parent);
265265
++ParentIndex) {
266266
const Stmt *NewParent = NodeTree[ParentIndex + 1].getStmtOrNull();
267267
if (!NewParent)

0 commit comments

Comments
 (0)