Changeset 397c101


Ignore:
Timestamp:
Nov 27, 2019, 4:43:51 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
524627e, 78cdb06, d4f1521
Parents:
152c2b2
Message:

Fix bug where 'continue' would incorrectly claim to skip initialization Fixes #150?

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/MLEMutator.cc

    r152c2b2 r397c101  
    231231
    232232        Statement *MLEMutator::mutateLoop( Statement *bodyLoop, Entry &e ) {
     233                // only generate these when needed
     234                if( !e.isContUsed() && !e.isBreakUsed() ) return bodyLoop;
     235
    233236                // ensure loop body is a block
    234                 CompoundStmt *newBody;
    235                 if ( ! (newBody = dynamic_cast<CompoundStmt *>( bodyLoop )) ) {
    236                         newBody = new CompoundStmt();
    237                         newBody->get_kids().push_back( bodyLoop );
    238                 } // if
    239 
    240                 // only generate these when needed
     237                CompoundStmt * newBody = new CompoundStmt();
     238                newBody->get_kids().push_back( bodyLoop );
    241239
    242240                if ( e.isContUsed() ) {
  • tests/raii/dtor-early-exit.cfa

    r152c2b2 r397c101  
    217217}
    218218
     219void i() {
     220        // potential loop
     221        for() {
     222                if(true) continue;
     223                int t = 0;
     224        }
     225}
     226
    219227// TODO: implement __label__ and uncomment these lines
    220228void computedGoto() {
Note: See TracChangeset for help on using the changeset viewer.