Return statement in the loop body must be consistent. The default assumption for any kind of a loop is that it will eventually terminate. The only exception is a loop with a constant true condition. Code that follows such a loop is examined only if one can statically determine that there is a break
()
| 797 | * @return logical OR of END_* flags |
| 798 | */ |
| 799 | private int endCheckLoop() { |
| 800 | Node n; |
| 801 | int rv = END_UNREACHED; |
| 802 | |
| 803 | // To find the loop body, we look at the second to last node of the |
| 804 | // loop node, which should be the predicate that the loop should |
| 805 | // satisfy. |
| 806 | // The target of the predicate is the loop-body for all 4 kinds of |
| 807 | // loops. |
| 808 | for (n = first; n.next != last; n = n.next) { |
| 809 | /* skip */ |
| 810 | } |
| 811 | if (n.type != Token.IFEQ) return END_DROPS_OFF; |
| 812 | |
| 813 | // The target's next is the loop body block |
| 814 | rv = ((Jump) n).target.next.endCheck(); |
| 815 | |
| 816 | // check to see if the loop condition is true |
| 817 | if (n.first.type == Token.TRUE) rv &= ~END_DROPS_OFF; |
| 818 | |
| 819 | // look for effect of breaks |
| 820 | rv |= getIntProp(CONTROL_BLOCK_PROP, END_UNREACHED); |
| 821 | |
| 822 | return rv; |
| 823 | } |
| 824 | |
| 825 | /** |
| 826 | * A general block of code is examined statement by statement. If any statement (even compound |
no test coverage detected