public boolean doesNotContainContinueOrBreak ( Instruction _start , Instruction _extent ) { boolean ok = true ; boolean breakOrContinue = false ; for ( Instruction i = _start ; i != null ; i = i . getNextExpr ( ) ) { if ( i . isBranch ( ) ) { if ( i . asBranch ( ) . isForwardUnconditional ( ) && i . asBranch ( ) . getTarget ( ) . isAfter ( _extent ) ) { breakOrContinue = true ; } else { ok = false ; break ; } } } if ( ok ) { if ( breakOrContinue ) { for ( Instruction i = _start ; i != null ; i = i . getNextExpr ( ) ) { if ( i . isBranch ( ) && i . asBranch ( ) . isForwardUnconditional ( ) && i . asBranch ( ) . getTarget ( ) . isAfter ( _extent ) ) { i . asBranch ( ) . setBreakOrContinue ( true ) ; } } } } return ( ok ) ; }
Determine whether the sequence of instructions from _start to _extent is free of branches which extend beyond _extent .