Endless loop in Sema::ArgumentDependentLookup

Richard Smith richard at metafoo.co.uk
Fri Jul 12 13:24:45 PDT 2013


On Fri, Jul 12, 2013 at 4:38 AM, Stephan Bergmann <sbergman at redhat.com> wrote:
> Looks like trunk r186040 introduced a typo in lib/Sema/SemaLookup.cpp that
> can cause endless loops, fix would apparently be:
>
>> Index: lib/Sema/SemaLookup.cpp
>> ===================================================================
>> --- lib/Sema/SemaLookup.cpp     (revision 186153)
>> +++ lib/Sema/SemaLookup.cpp     (working copy)
>> @@ -2758,7 +2758,7 @@
>>        // it only if it was declared in an associated classes.
>>        if (D->getIdentifierNamespace() == Decl::IDNS_OrdinaryFriend) {
>>          bool DeclaredInAssociatedClass = false;
>> -        for (Decl *DI = D; DI; DI = D->getPreviousDecl()) {
>> +        for (Decl *DI = D; DI; DI = DI->getPreviousDecl()) {
>>            DeclContext *LexDC = DI->getLexicalDeclContext();
>>            if (AssociatedClasses.count(cast<CXXRecordDecl>(LexDC))) {
>>              DeclaredInAssociatedClass = true;

Oops, thank you!



More information about the cfe-commits mailing list