[Soot-list] Is Stmt part of if-branch
Bernhard Berger
berber at tzi.de
Mon Aug 26 01:43:48 EDT 2013
Hi Thomas,
I think you can use the dominator information (see [1]) to calculate the results. Perhaps you can try [2].
Regards,
Bernhard
[1] http://en.wikipedia.org/wiki/Dominator_(graph_theory)
[2] http://www.sable.mcgill.ca/soot/doc/soot/toolkits/graph/SimpleDominatorsFinder.html
Am 15.08.2013 um 19:15 schrieb Herr Thomas Vogel <vogel.thomas at me.com>:
> Hi everybody,
>
> I' ve following issue:
> I want to know if a statement in jimple depends on an specific IfStmt. Is there any solution for solving this problem.
>
> For example following Java code:
>
> public void dependsOnIf() {
> boolean a = true;
> if (a) {
> System.out.println("Depends on 'if (a)' -> if-branch.");
> } else {
> System.out.println("Depends on 'if (a)' -> else-branch.");
> }
> System.out.println("Depends on nothing.");
> }
>
> Results in the following jimple code (attached is the desired result as comment):
>
> this := @this: TaintTrackingTest /* depends on nothing */
> a = 1 /* depends on nothing */
> if a == 0 goto nop /* depends on nothing */
> nop
> temp$1 = <java.lang.System: java.io.PrintStream out> /* depends on if a == 0 */
> virtualinvoke temp$1.<java.io.PrintStream: void print(java.lang.String)>("Depends on \'if (a)\' -> else-branch.") /* depends on if a == 0 */
> goto [?= nop]
> nop
> temp$0 = <java.lang.System: java.io.PrintStream out> /* depends on if a == 0 */
> virtualinvoke temp$0.<java.io.PrintStream: void println(java.lang.String)>("Depends on \'if (a)\' -> if-branch.") /* depends on if a == 0 */
> goto [?= nop]
> nop
> temp$2 = <java.lang.System: java.io.PrintStream out> /* depends on nothing */
> virtualinvoke temp$2.<java.io.PrintStream: void println(java.lang.String)>("Depends on nothing.") /* depends on nothing */
> return
>
> Regards,
> Thomas
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130826/acbf6df1/attachment.html
More information about the Soot-list
mailing list