[Soot-list] Type inference in Soot for Java polymorphism?

Richard Xiao richardxx at cse.ust.hk
Tue Jan 22 00:09:57 EST 2013


Of course, try SPARK, the points-to analysis in soot. You will obtain a
list of objects "cat" can point to. Compute the lowest common ancestor of
the types of these pointed to objects, that's the answer.


On Tue, Jan 22, 2013 at 10:56 AM, Yi Lin <qinsoon at gmail.com> wrote:

> Hi,
>
> For example.
>
> For Java code,
>      Animal cat = new Cat();
>      cat.speak();
>
> Jimple code is like,
> Locals:
>      [Animal]cat
>      [Cat]temp$0
> Code:
>      temp$0 = new Cat
>      specialinvoke temp$0.<Cat: void <init>()>()
>      cat = temp$0
>      virtualinvoke cat.<Animal: void speak()>()
>
> Is it possible for Soot to tell that the variable 'cat' actually holds a
> 'Cat' object instead of an 'Animal'?
>
> If not, is it possible for me to implement such analysis on Soot
> framework (especially for inter-procedure cases)? Without using dynamic
> loading in the Java code, and with whole program analysis turned on in
> Soot, I assume it should be possible to do such type inference.
>
> Any idea would be appreciated. Thank you very much.
>
> Regards,
> Yi
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>



-- 
Richard Xiao Xiao
PhD Student @ CSE @ Hong Kong University of Science and Technology
www.cse.ust.hk/~richardxx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130122/db584900/attachment.html 


More information about the Soot-list mailing list