| Issue |
180228
|
| Summary |
[clang-repl] getFETokenInfo is called without checking whether getDeclName() is returning a valid value while CleanUpPTU
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
Evianaive
|
<img width="1342" height="203" alt="Image" src="" />
for (Decl *D : MostRecentTU->decls()) {
auto *ND = dyn_cast<NamedDecl>(D);
if (!ND)
continue;
// Check if we need to clean up the IdResolver chain.
if (ND->getDeclName().getFETokenInfo() && !D->getLangOpts().ObjC &&
!D->getLangOpts().CPlusPlus)
S.IdResolver.RemoveDecl(ND);
}
ND->getDeclName() returns ND->Name, which is 0. Then getFETokenInfo is called without check.
It can happens when compile failed(clang::interpreter will CleanUpPTU automatically) or manually undo by user.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs