Ignore:
Timestamp:
Apr 16, 2018, 3:21:17 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
fb97252f
Parents:
6f81db3
Message:

Fix more missing visits in GcTracer?, add cycle detection back in, ensure mark isn't broken by defaulted GC_Object copy and assign

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/GcTracer.h

    r6f81db3 r24de7b1  
    3838        void previsit( BaseSyntaxNode * node ) {
    3939                // skip tree if already seen
    40                 // xxx - this should be uncommented (it breaks object cycles), but at the moment it seems
    41                 // like the object cycles don't happen and other bugs do
    42                 // if ( node->mark == gc.mark ) {
    43                 //      visit_children = false;
    44                 //      return;
    45                 // }
     40                if ( node->mark == gc.mark ) {
     41                        visit_children = false;
     42                        return;
     43                }
    4644
    4745                // mark node
     
    5048
    5149        // add visits left out by PassVisitor
     50
     51        void postvisit( Constant* con ) {
     52                maybeAccept( con->get_type(), *visitor );
     53        }
    5254
    5355        void postvisit( Expression* expr ) {
     
    5860                postvisit( static_cast<Expression*>(expr) );
    5961                maybeAccept( expr->function, *visitor );
     62        }
     63
     64        void postvisit( VariableExpr* expr ) {
     65                postvisit( static_cast<Expression*>(expr) );
     66                maybeAccept( expr->var, *visitor );  // not in PassVisitor because it causes cycle
    6067        }
    6168
Note: See TracChangeset for help on using the changeset viewer.