[Soot-list] how to get the result of a conditionexpr

Eric Bodden eric.bodden at mail.mcgill.ca
Wed Sep 5 09:08:19 EDT 2007


You cannot generally do this because obviously in general the value
might not be known at compile time. For easy cases like the one you
mentioned, you can do the following:

1.) Apply the ConstantPropagatorAndFolder to the method body.
2.) Get the expression from the if statement. If the value is
statically decidable, it should now be an IntConstant, if I am not
mistaken.

Look at this constant and see if it's 0 or 1.

Eric


On 04/09/07, anson wong <wganson at gmail.com> wrote:
> i would like to do a profiling program to trace the result of a ifstmt (e.g.
> true/ false)
> but i can't fine a method under the type "conditionExpr" can get it's return
> value
> like ( 10 > 1) , it should return "true"
>
> anyone can help me?
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>


-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list