[Soot-list] method has an invalid active body!

Uwe Dolinsky u.dolinsky at iname.com
Tue Oct 12 12:01:08 EDT 2004


The transformer is added to phase "jop". The method body that is
passed into the transformers internalTransform expectedly is a JimpleBody,
but at this point all other method bodies (except the newly generated 
method)
in my testclass have already been converted into Baf.
How do I get Soot to include that newly generated Jimple method into that
conversion into Baf? 

Thanks
Uwe


 > > I've written a Jimple transformer that builds (in its internalTransform
 > > method)
 > > a new method using Jimple.
 > > This is a snippet of the code I use before adding statements to 
that new
 > > method:
 > >
 > >         DeclClass.addMethod(method);
 > >          JimpleBody body = Jimple.v().newBody(method);
 > >          method.setActiveBody(body);
 >
 > This sounds like a phase ordering problem.  Which phase are you adding
 > your Jimple transformer to?  If you add it after other Jimple bodies have
 > been converted to Baf, then the code generator will get confused.  In
 > particular, in that phase, you should try and query a random method of
 > DeclClass and see what bodies it has.
 >
 > pat
 >
 >
 >



More information about the Soot-list mailing list