[Soot-list] Reflection Method

Peng Gao gaop at cse.unsw.edu.au
Thu Jan 25 00:33:59 EST 2007


Hi,

I am using soot to generate PAG for some analysis. However, when I am
running soot on some code with invocation to reflection methods like
java.lang.Class: newInstance(), for example:

String input = in.readLine();
Class clazz = Class.forName(input);
Object obj = clazz.newInstance();
ClassJ j = new ClassJ();
ClassK k = new ClassK();

I can only find two objects:
AllocNode 4014 new pakD.ClassK in method <pakD.ClassI: void main 
(java.lang.String[])>
AllocNode 4013 new pakD.ClassJ in method <pakD.ClassI: void main 
(java.lang.String[])>

I turned the option 'safe-newInstance' on and soot should assume  
newInstance() to call any constructor.
I am expecting to see some other allocNode created by the  
constructors invoked by newInstance(), but I didn't find any.

So i am just wondering if I need to turn on some other options and  
how does soot treat with the objects created in each constructor  
invoked by reflection method?

Thank you very much for your help.

Cheers

Peng Gao


More information about the Soot-list mailing list