[Soot-list] Is Stmt part of if-branch

Herr Thomas Vogel vogel.thomas at me.com
Thu Aug 15 13:15:12 EDT 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130815/d706c8fc/attachment.html 


More information about the Soot-list mailing list