Skip to content

Commit 8a27707

Browse files
committed
Fix infinite loop by updating tail ptr
1 parent 18bcbc0 commit 8a27707

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/AST/DeclBase.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,9 @@ DeclContext::BuildDeclChain(ArrayRef<Decl *> Decls,
12571257
PrevDecl = D;
12581258
}
12591259

1260+
// The last one in the chain should have a null next!
1261+
PrevDecl->NextInContextAndBits.setPointer(nullptr);
1262+
12601263
return std::make_pair(FirstNewDecl, PrevDecl);
12611264
}
12621265

0 commit comments

Comments
 (0)