You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and from there, I want to start a follow up query for s.
import java.util.Scanner;
import ConstantPropagationTest;
public class Test1 {
/**
* Our constant propagation finds the definition of the return value here
* and knows (by looking up a list of builtin summaries) that it needs to
* perform a follow-up {@link boomerang.BackwardQuery} for s.
* However, this follow-up query does not share the {@link boomerang.Context} of the original
* query, so when it steps out of {@link #loosingTrackOfThings(String)}, it does not remember
* that it came from {@link #entryPoint()} and explores all possible call sites instead.
*
* @param s Some string that's being passed through.
* @return The same string that was passed as an argument.
*/
public static String loosingTrackOfThings(String s) {
return new StringBuilder(s).toString();
}
public void entryPoint() {
Scanner scanner = new Scanner(System.in);
String fooTest1 = scanner.next();
final String bar = loosingTrackOfThings(fooTest1);
ConstantPropagationTest.assertReachesSources(bar, "java.util.Scanner:");
}
public void unreleatedMethod1() {
Scanner scanner = new Scanner(System.in);
String fooTest1 = scanner.nextLine();
final String bar = loosingTrackOfThings(fooTest1);
}
public void unreleatedMethod2() {
Scanner scanner = new Scanner(System.in);
String fooTest1 = scanner.toString();
final String bar = loosingTrackOfThings(fooTest1);
}
}
Currently, the second backward query finds reaching definitions in entryPoint, unreleatedMethod1, and unreleatedMethod2 because the second query doesn't get the call stack from the first.
Is there a way to share information between queries in Boomerang?
But the statement sootGraph.addEdge(new CallGraph.Edge(callSiteStatement, JimpleMethod.of(method))); doesn't seem to have an effect on the recursive query.
Also, I noticed that the CallSiteStatement and ReturnSiteStatement classes disappeared in 3.1.1; is there an immediate need to update to that version is it ok to stay on an older release?
Activity
johspaeth commentedon Sep 15, 2020
The query graph can be used to tell a query which paths to follow. I pointed out details here:
CROSSINGTUD#92
martinschaef commentedon Sep 15, 2020
Hmm ... looks like I'm doing it wrong. Here a sketch of my setup (not syntactically correct):
But the statement
sootGraph.addEdge(new CallGraph.Edge(callSiteStatement, JimpleMethod.of(method)));doesn't seem to have an effect on the recursive query.martinschaef commentedon Sep 15, 2020
Also, I noticed that the
CallSiteStatementandReturnSiteStatementclasses disappeared in 3.1.1; is there an immediate need to update to that version is it ok to stay on an older release?Merge branch 'issue/#9' into issue/#5
Merge branch 'issue/#5' into issue/#9
Merge branch 'issue/#9' into develop
Adding test cases for kill flow and array propagation (#9)