[PATCH] D26664: [ObjC] Prevent infinite loops when iterating over redeclaration of a method that was declared in an invalid interface
Mehdi AMINI via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 15 09:06:32 PST 2016
mehdi_amini accepted this revision.
mehdi_amini added a comment.
This revision is now accepted and ready to land.
LGTM, thks.
(See one inline comment to fix though)
================
Comment at: lib/AST/DeclObjC.cpp:841
+ return nullptr;
+ if (const auto *Ctx = cast<Decl>(Redecl->getDeclContext()))
+ if (Ctx->isInvalidDecl())
----------------
Either you should use `dyn_cast`, or you should just `cast` but without a `if`
Repository:
rL LLVM
https://reviews.llvm.org/D26664
More information about the cfe-commits
mailing list