[Soot-list] Reflection Method
Ondrej Lhotak
olhotak at uwaterloo.ca
Thu Jan 25 15:39:34 EST 2007
On Thu, Jan 25, 2007 at 04:33:59PM +1100, Peng Gao wrote:
> 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?
The -dynamic-class option tells Soot that a given class may be loaded by
reflection.
>
> Thank you very much for your help.
>
> Cheers
>
> Peng Gao
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
More information about the Soot-list
mailing list