[Soot-list] Problem with access to .class

Marco Bakera marco.bakera at uni-dortmund.de
Thu Aug 30 10:20:30 EDT 2007


The problem occurs when invoking the code

  G.reset();
  Main.main(new String[]{Testclass2.class.getName()});

on the following Testclass2

  public class Testclass2 {

      public Testclass2() {
          Class c = Testclass2.class;
          System.out.println("Testclass2.Testclass2() c="+c);
      }
  }


On Thursday 30 August 2007 15:14, Chris Pickett wrote:
> Hi Marco,
>
> Please attach a test case.
>
> Chris
>
> Marco Bakera wrote:
> > Hey everybody!
> >
> > I am using Soot to transform Java source code into control flow graphs
> > (namely Unit graphs in Soot). However there are some problems whenever
> > there is access to the .class member in the source code. In such a case
> > the following rather cryptic exception occurs.
> >
> > java.lang.RuntimeException: Attempting to push a non-constant cp entry
> > 	at soot.coffi.CFG.processCPEntry(CFG.java:2716)
> > 	at soot.coffi.CFG.processFlow(CFG.java:1717)
> > 	at soot.coffi.CFG.jimplify(CFG.java:1341)
> > 	at soot.coffi.CFG.jimplify(CFG.java:1125)
> > 	at soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:98)
> > 	at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:80)
> > 	at soot.SootMethod.retrieveActiveBody(SootMethod.java:304)
> > 	at soot.PackManager.retrieveAllBodies(PackManager.java:711)
> > 	at soot.PackManager.runPacks(PackManager.java:302)
> > 	at soot.Main.run(Main.java:179)
> > 	at soot.Main.main(Main.java:153)
> >
> > If there is not access to .class everything is running fine.
> >
> > Any suggestions how to circumvent the problem?
> >
> > Thanks for any help in advance. :)
> >
> > Greetings,
> > Marco Bakera.
> >
> > PS
> > I am using sootall-2.2.4.jar.


More information about the Soot-list mailing list