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

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


> 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


More information about the Soot-list mailing list