[Soot-list] Re: Global variables in soot

Eric Bodden eric.bodden at mail.mcgill.ca
Fri May 4 14:15:51 EDT 2007


Ok, so what you mean by global variables are actually fields. it's as
I said: local variables are represented by soot.Local's and
fields/global variables by soot.jimple.FieldRef's.

Eric

On 04/05/07, John Chaitanya Kati <johnkati at cse.iitb.ac.in> wrote:
> By global variables i meant, which are available to all the methods of the
> class.
> class Test
> {       static public int a=5;
>         static public void main(String args[])
>         {
>                 int b=10,c;
>                 c = a*b;
>                 add(a,b);
>         }
>         static void add(int i, int j)
>         {
>                 i=i+j;
>                 a=15;
>         }
> }
> a is global, b,c are local to main. I want to find out such variables.
>
>
>
>
>
>
>
>
>
>
>
> On Fri, 4 May 2007, Eric Bodden wrote:
>
> > What's a global variable?
> >
> > Soot knows variables of type soot.Local. Those are obviously local.
> > Then there also are field references, which are obviously field
> > references. Are those what you mean by global? (Of course, a local can
> > well be assigned a field reference, the same way as it can happen in
> > Java code.)
> >
> > Eric
> >
> > On 04/05/07, John Chaitanya Kati <johnkati at cse.iitb.ac.in> wrote:
> >> Hi,
> >>    Is there a way to find out if a variable is global or not in soot ?
> >>
> >> --
> >> Thanks for any help in advance
> >> John Chaitanya
> >>
> >
> >
> >
>
> --
>
> Thanks
> John Chaitanya
> Like a rose trampled on the ground, you took the fall and thought of me...
>


-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list