Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/InitTweak.cc

    rc738ca4 rcad355a  
    6666                } else if ( CompoundStmt * compoundStmt = dynamic_cast< CompoundStmt * >( stmt ) ) {
    6767                        // could also be a compound statement with a loop, in the case of an array
    68                         assert( compoundStmt->get_kids().size() == 2 ); // loop variable and loop
    69                         ForStmt * forStmt = dynamic_cast< ForStmt * >( compoundStmt->get_kids().back() );
    70                         assert( forStmt && forStmt->get_body() );
    71                         return getCtorDtorCall( forStmt->get_body() );
     68                        if( compoundStmt->get_kids().size() == 2 ) {
     69                                // loop variable and loop
     70                                ForStmt * forStmt = dynamic_cast< ForStmt * >( compoundStmt->get_kids().back() );
     71                                assert( forStmt && forStmt->get_body() );
     72                                return getCtorDtorCall( forStmt->get_body() );
     73                        } else if ( compoundStmt->get_kids().size() == 1 ) {
     74                                // should be the call statement, but in any case there's only one option
     75                                return getCtorDtorCall( compoundStmt->get_kids().front() );
     76                        } else {
     77                                assert( false && "too many statements in compoundStmt for getCtorDtorCall" );
     78                        }
    7279                } if ( ImplicitCtorDtorStmt * impCtorDtorStmt = dynamic_cast< ImplicitCtorDtorStmt * > ( stmt ) ) {
    7380                        return getCtorDtorCall( impCtorDtorStmt->get_callStmt() );
Note: See TracChangeset for help on using the changeset viewer.