Clepsydra's tree analysis algorithm (TreeAnalysisStrategy.java) does not correctly handle return statements that occur anywhere other than at the end of a method. (Clepsydra's IPET analysis algorithm handles them correctly.)
For example:
public boolean test(boolean b) {
if (b) {
return false;
}
return false;
}
An easy fix for this problem is to change the handling of the if statement slightly so that if the "then" branch ends with a return statement, the algorithm considers the statements following the if as its "else" branch.
Unfortunately, this solution doesn't work for slightly more complicated examples such as:
private Object o, p;
public boolean test(boolean b) {
if (o == null) {
if (p == null) {
return false;
}
b = true;
}
return false;
}
Logged In: YES
user_id=720008
Originator: YES
FWIW, the Heptane WCET analyzer disallows multiple return statements in a method.