[Soot-list] Type Analysis in Soot
Pallavi Majumder
s8pamaju at stud.uni-saarland.de
Thu Feb 15 09:25:18 EST 2018
Hi Nikhil,
Yes, of course, it is there in Soot. The best way to go about is to
simply convert your class to jimple which would give you a perfect
outlook of how Soot will actually process your code. At least that's
the thumb rule I followed and it was the fastest and most efficient
way of understanding Soot.
Regards,
Pallavi
Quoting Nikhil <cs16m028 at smail.iitm.ac.in>:
> Hi,
>
> I just started using soot. I want to know that whatever I am
> looking for is already there in soot?
>
> Consider the following example program.
>
> class Example {
> public static void main(String[] args) {
> Scanner sc = new Scanner(System.in);
> int x = sc.nextInt();
> List<Integer> l = null;
>
> // x will be in between 1 and 3 only.
>
> switch (x) {
> case 1:
> l = new ArrayList<>();
> break;
> case 2 :
> l = new LinkedList<>();
> break;
> case 3 :
> l = new Vector<>();
> break;
> }
>
> //At this point l might take one of this [ArrayList,
> LinkedList, Vector]
> //Is this any analysis in Soot to get the above information?
>
> ArrayList<Integer> al = new ArrayList<>();
> for (int i=0;i<4 ;i++ ) {
> al.add(i);
> }
> l.addAll(al);
> System.out.println(l);
> }
> }
>
> If some analysis is there, an explanation with a code will be very helpful.
> Thanks in advance.
>
> Cheers,
> --Nikhil
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20180215/93e7b629/attachment.html>
More information about the Soot-list
mailing list