Changeset 397c101a for src


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/MLEMutator.cc

    r152c2b2 r397c101a  
    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() ) {
Note: See TracChangeset for help on using the changeset viewer.