[Soot-list] creating object of class in its own function

suraj kath surajkath108 at gmail.com
Sat Mar 5 11:12:51 EST 2011


i wrote the code
please tell me what is wrong with this
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20110305/e0722bce/attachment.html 
-------------- next part --------------
protected void internalTransform(Body body, String phase, Map options) {
    

  




		SootMethod method = body.getMethod();


		sClass=method.getDeclaringClass();

                        

                      Chain units=body.getUnits();

                      Stmt stmt=null;
                       Iterator stmtIt = units.snapshotIterator();
                     
                    
                      stmt= (Stmt)stmtIt.next();



                      Local obj=Jimple.v().newLocal("obj",sClass.getType());
                      body.getLocals().add(obj);


                     Stmt assstm= Jimple.v().newAssignStmt(obj, Jimple.v().newNewExpr(sClass.getType()));


                      units.insertAfter(assstm,stmt);//it is inserting the object but then running the class file causes error


  }
    





  


More information about the Soot-list mailing list