Class Verifier

java.lang.Object
com.ibm.wala.shrike.shrikeBT.analysis.Analyzer
com.ibm.wala.shrike.shrikeBT.analysis.Verifier

public final class Verifier extends Analyzer
This class typechecks intermediate code. It's very easy to use:

      MethodData md = ...;
      try {
          (new Verifier(md)).verify();
      } catch (Verifier.FailureException ex) {
          System.out.println("Verification failed at instruction "
              + ex.getOffset() + ": " + ex.getReason());
      }

 
For full verification you need to provide class hierarchy information using setClassHierarchy. Without this information, we can't compute the exact types of variables at control flow merge points. If you don't provide a hierarchy, or the hierarchy you provide is partial, then the Verifier will be optimistic.

This method can also be used to gather type information for every stack and local variable at every program point. Just call computeTypes() instead of verify() and then retrieve the results with getLocalTypes() and getStackTypes().