Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/MultiLevelExit.cpp

    rf75e25b r400b8be  
    588588                }
    589589
    590                 ptr<Stmt> else_stmt = nullptr;
    591                 Stmt * loop_kid = nullptr;
    592                 // check if loop node and if so add else clause if it exists
    593                 const WhileDoStmt * whilePtr = dynamic_cast<const WhileDoStmt *>(kid.get());
    594                 if ( whilePtr && whilePtr->else_) {
    595                         else_stmt = whilePtr->else_;
    596                         WhileDoStmt * mutate_ptr = mutate(whilePtr);
    597                         mutate_ptr->else_ = nullptr;
    598                         loop_kid = mutate_ptr;
    599                 }
    600                 const ForStmt * forPtr = dynamic_cast<const ForStmt *>(kid.get());
    601                 if ( forPtr && forPtr->else_) {
    602                         else_stmt = forPtr->else_;
    603                         ForStmt * mutate_ptr = mutate(forPtr);
    604                         mutate_ptr->else_ = nullptr;
    605                         loop_kid = mutate_ptr;
    606                 }
    607 
    608590                try {
    609                         if (else_stmt) ret.push_back( loop_kid->accept( *visitor ) );
    610                         else ret.push_back( kid->accept( *visitor ) );
     591                        ret.push_back( kid->accept( *visitor ) );
    611592                } catch ( SemanticErrorException & e ) {
    612593                        errors.append( e );
    613594                }
    614 
    615                 if (else_stmt) ret.push_back(else_stmt);
    616595
    617596                if ( ! break_label.empty() ) {
Note: See TracChangeset for help on using the changeset viewer.