[Soot-list] Question about Value vs Stmt in Jimple

Eric Bodden eric.bodden at ec-spride.de
Thu Oct 18 13:43:28 EDT 2012


Oh sorry, I think I made a mistake.

Not every unit is inside a unit box. Only those units that are targets
e.g. of a goto statement are. I think that explains your observation,
doesn't it?

Eric

On 18 October 2012 19:41, Jiaqi Tan <jiaqit at andrew.cmu.edu> wrote:
> Do the Stmts get populated only when I run the whole-program
> transformation and the wjtp pack?
>
> Thanks,
> Jiaqi
>
> On Thu, Oct 18, 2012 at 1:28 PM, Eric Bodden <eric.bodden at ec-spride.de> wrote:
>>> If I'm getting UseBoxes that do not show up in any of the UnitBoxes
>>> from getAllUnitBoxes(), does that mean that there are values that are
>>> created but not used? Then what is the relationship between Stmt's and
>>> the Boxes? Are all UseBoxes and DefBoxes contained within all Stmts
>>> returned from getAllUnitBoxes()?
>>
>> What you describe actually cannot happen. Maybe you are
>> misinterpreting something?
>>
>> Take a look at the definitions:
>>
>>  public List<UnitBox> getAllUnitBoxes()
>>     {
>>         ArrayList<UnitBox> unitBoxList = new ArrayList<UnitBox>();
>>         {
>>             Iterator<Unit> it = unitChain.iterator();
>>             while(it.hasNext()) {
>>                 Unit item = it.next();
>>                 unitBoxList.addAll(item.getUnitBoxes());
>>             }
>>         }
>>
>>         {
>>             Iterator<Trap> it = trapChain.iterator();
>>             while(it.hasNext()) {
>>                 Trap item = it.next();
>>                 unitBoxList.addAll(item.getUnitBoxes());
>>             }
>>         }
>>
>>         {
>>             Iterator<Tag> it = getTags().iterator();
>>             while(it.hasNext()) {
>>                 Tag t = it.next();
>>                 if( t instanceof CodeAttribute)
>>                     unitBoxList.addAll(((CodeAttribute) t).getUnitBoxes());
>>             }
>>         }
>>
>>         return unitBoxList;
>>     }
>>
>>     public List<ValueBox> getUseBoxes()
>>     {
>>         ArrayList<ValueBox> useBoxList = new ArrayList<ValueBox>();
>>
>>         Iterator<Unit> it = unitChain.iterator();
>>         while(it.hasNext()) {
>>             Unit item = it.next();
>>             useBoxList.addAll(item.getUseBoxes());
>>         }
>>         return useBoxList;
>>     }
>>
>>
>> Eric



-- 
Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt


More information about the Soot-list mailing list