[Soot-list] Jimple: distinguish if and if else

Pedro Louro pedrolour at gmail.com
Thu Mar 31 10:46:17 EDT 2011


Hello Eric,

I´m not getting how can I test if some statement is the end of the if
block or not.
Giving a visual example, in attachment there are two examples, one
normal if and one if else.
In both cases the JIfStmt points to two different statements - I get
one by the units.getSuccOf and the other by the UnitBoxes - the nop,
and the goto nop.
The difference is that in the normal if the nop is the end of the if
block, which is not the case with if else. I´ve tryied the
getBoxesPointingToThis().size() but the number is 1 in both cases.

Thank you for your great help!

Best Regards
Pedro Louro

On 31 March 2011 08:20, Eric Bodden
<bodden at st.informatik.tu-darmstadt.de> wrote:
> Hi Pedro.
>
> I think that's something you can just figure out by looking at the
> code following the if statement. If after the if statement you have a
> jump directly to the end of the "if block" then it's a "normal if". If
> there's other code in front of that goto then you have an
> if-then-else.
>
> Eric
>
> On 31 March 2011 02:25, Pedro Louro <pedrolour at gmail.com> wrote:
>> Hello,
>>
>> When I´m analysing a JIfStmt, is there any practical way of
>> distinguish if it is just an if or an if+else?
>> In any case the JIfStmt has a bifurcation and I´m not seeing a
>> straight forward way to test this.
>>
>> Best Regards
>> Pedro Louro
>> _______________________________________________
>> Soot-list mailing list
>> Soot-list at sable.mcgill.ca
>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>
>
>
>
> --
> Dr. Eric Bodden, http://bodden.de/
> Principal Investigator in Secure Services at CASED
> Coordinator of the CASED Advisory Board of Study Affairs
> PostDoc at Software Technology Group, Technische Universität Darmstadt
> Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
> Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: if.jpg
Type: image/jpeg
Size: 31483 bytes
Desc: not available
Url : http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20110331/10f27046/attachment-0002.jpg 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ifElse.jpg
Type: image/jpeg
Size: 52842 bytes
Desc: not available
Url : http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20110331/10f27046/attachment-0003.jpg 


More information about the Soot-list mailing list