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

Yi Lin qinsoon at gmail.com
Mon Jan 21 21:56:55 EST 2013


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


More information about the Soot-list mailing list