Changeset 22cad76


Ignore:
Timestamp:
Jun 28, 2016, 5:28:45 PM (8 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
66999e7
Parents:
466149d
git-author:
Aaron Moss <a3moss@…> (06/27/16 16:36:52)
git-committer:
Aaron Moss <a3moss@…> (06/28/16 17:28:45)
Message:

Second attempt to break resolver loop

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    r466149d r22cad76  
    411411        }
    412412
    413         /// Map of declarations (intended to be the assertions in an AssertionSet) to their parents and the number of times they've been included
    414         typedef std::unordered_map< DeclarationWithType*, std::unordered_map< DeclarationWithType*, unsigned > > AssertionParentSet;
     413        /// Map of declaration uniqueIds (intended to be the assertions in an AssertionSet) to their parents and the number of times they've been included
     414        typedef std::unordered_map< UniqueId, std::unordered_map< UniqueId, unsigned > > AssertionParentSet;
    415415       
    416416        static const int recursionLimit = 10;  ///< Limit to depth of recursion satisfaction
     
    464464                                std::cerr << std::endl;
    465465                        )
    466                         AssertionParentSet newNeedParents( needParents );
    467                         // skip repeatingly-self-recursive assertion satisfaction
    468                         if ( newNeedParents[ curDecl ][ *candidate ]++ > recursionParentLimit ) return;
    469466                       
    470467                        AssertionSet newHave, newerNeed( newNeed );
     
    490487                                newerAlt.env = newEnv;
    491488                                assert( (*candidate)->get_uniqueId() );
    492                                 Expression *varExpr = new VariableExpr( static_cast< DeclarationWithType* >( Declaration::declFromId( (*candidate)->get_uniqueId() ) ) );
     489                                DeclarationWithType *candDecl = static_cast< DeclarationWithType* >( Declaration::declFromId( (*candidate)->get_uniqueId() ) );
     490                                AssertionParentSet newNeedParents( needParents );
     491                                // skip repeatingly-self-recursive assertion satisfaction
     492                                if ( newNeedParents[ curDecl->get_uniqueId() ][ candDecl->get_uniqueId() ]++ > recursionParentLimit ) continue;
     493                                Expression *varExpr = new VariableExpr( candDecl );
    493494                                deleteAll( varExpr->get_results() );
    494495                                varExpr->get_results().clear();
Note: See TracChangeset for help on using the changeset viewer.