[Soot-list] Interprocedural constant propagation and code folding

Attila Bartha at.bartha at gmail.com
Wed Nov 11 18:38:15 EST 2009


Hi Varun

It is not clear what your "target question" is, i.e. what result do you
expect from your data analysis? Could you elaborate on that? What data do
you want to calculate?

The solution could be quite demanding. For instance, it could require
symbolic calculation and algebra to deal with variables in conditions on the
way. In this case, I am not aware of existing solutions using soot.
 
To illustrate this, consider the example below. An interesting question
would be:  
  What is the side effect of calling B, i.e. what "newScore" is "stored" and
under which condition?


B(boolean val){
  if(val) { 
    print(); 
    c();
  }
  else 
  {
    int newScore = 0;
    if (((cust.score > 100) && (cust.contracts.size() > 5)) || agent.role ==
SUPERVISOR) 
    {
      newScore = calcX(chances * 3);
    }
    else if (temperature > 21.5) 
    {
      newScore = calcX((chances / 2 + cust.contracts.size() * 3);
    }
    
    if (newScore > cust.score) 
    {
      store(cust, newScore);               <----- side effect
    }
  }
}

Best regards

Attila


-----Original Message-----
From: soot-list-bounces at sable.mcgill.ca
[mailto:soot-list-bounces at sable.mcgill.ca] On Behalf Of varun
Sent: Mittwoch, 11. November 2009 19:13
To: soot-list at sable.mcgill.ca
Subject: [?? Probable Spam] [Soot-list] Interprocedural constant propagation
and code folding

Hi ,
 I am new to soot. I have code similar to the following snippet
A(){
  boolean a = false;
  B(a);
}


B(boolean val){
  if(val){ print(); c();}
  else{s();}
}

Now while performing interprocedural data analysis for method A , I
retrieve the jimple body of method B. But now since argument val for B
is false , I want to skip if part of the code in B. So somehow I need
the constant propagation with dynamic code folding depending upon the
parameters value. I am doing analysis in jimple format right now.
Please let me know what can be the best way to achieve my target
solution.
Thanks
Varun
_______________________________________________
Soot-list mailing list
Soot-list at sable.mcgill.ca
http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list



More information about the Soot-list mailing list