[Soot-list] SootResolver.bringToX...

Eric Bodden eric.bodden at ec-spride.de
Wed Dec 7 04:05:27 EST 2011


Hi all.

Today it's me who has a question :-)

I am having some students working on the SootResolver, and by looking
at the code I am getting more and more confused. I always thought that
the design was quite simple:

- bringToHierarchies loads a class up to its super classes and interfaces
- bringToSignatures loads methods and field signatures
- bringToBodies fills in the bodies
- All three methods load dependency classes to the required (lower levels).

But apparently, this is not quite the case. For instance, we find this
code in bringToSignatures:

    private void bringToSignatures(SootClass sc) {
        if(sc.resolvingLevel() >= SootClass.SIGNATURES ) return;
        bringToHierarchy(sc);
        sc.setResolvingLevel(SootClass.SIGNATURES);

        for( Iterator fIt = sc.getFields().iterator(); fIt.hasNext(); ) {
            final SootField f = (SootField) fIt.next();
            addToResolveWorklist( f.getType(), SootClass.HIERARCHY );
        }
   ...

As you can see here, this method iterates over all fields, which means
that at this point it assumes all field signatures to already be
present. In fact, the method does actually not do very much at all,
except adding dependencies to the worklist. In particular, it does not
really bring a class to signature level (except for changing the
resolving level).

Does anyone remember what was the intuition behind this?

Cheers,
Eric


More information about the Soot-list mailing list