Return statements in loop bodies cause problems
Status: Inactive
Brought to you by:
vocaro
When a return statement is inside a loop, Clepsydra (and probably Cascade, too) produce invalid results.
For example, this code causes problems because it has two ReturnStatement nodes:
while (val > 3)
if (b) return;
Here's another example; this one causes an ArrayIndexOutOfBoundsException:
while (val > 3)
if (b) return;
b = true;
Return statements inside other types of loops should also be checked.
Logged In: YES
user_id=720008
Originator: YES
Beware of potential problems, such as the strange bytecode produced by this example:
while (val > 3)
if (b)
{
b = true;
return;
}