[Soot-list] Unconditional branch statements

Patrick Lam plam at cs.mcgill.ca
Mon Apr 12 23:17:46 EDT 2010


On 04/12/10 20:54, Tristan RATCHFORD wrote:
> Hi Soot List,
>
> Is there a way to eliminate the following kinds of statements?
>
>     if temp$29 == 0 goto label5;
>
>     label5:
>           temp$30 = virtualinvoke tempS.<java.lang.String: int length()>();
>
>
> Both branches will end up at label 5 regardless of what temp$29
> evaluates to. I looked at all the pack options, but there is nothing
> that address this.
>
> I'm guessing I have to mess with the patching chain?

(oops, forgot to send reply to list)

Looks like the UnconditionalBranchFolder (soot.jimple.toolkits.scalar) 
does something like that, but it probably doesn't handle conditional 
branches like the one you showed. Take a look at it, see if there's any 
code similar to it in the codebase, and extend it if you need to.

pat


More information about the Soot-list mailing list