[Soot-list] A BUG about JimpleConstructorFolder and Line number or any options I did not turn on?

Eric Bodden eric.bodden at mail.mcgill.ca
Mon Apr 9 19:16:19 EDT 2007


We don't create a new-statement, we just move it, from what I can see.
(line 248)

Eric

On 09/04/07, Patrick Lam <plam at sable.mcgill.ca> wrote:
> Peng Li wrote:
> > private static int getLineNumber(Stmt s) {
> >         Iterator ti = s.getTags().iterator();
> >         while (ti.hasNext()) {
> >             Object o = ti.next();
> >             if (o instanceof LineNumberTag)
> >             {
> >             LineNumberTag linetag = (LineNumberTag) o;
> >             return linetag.getLineNumber();
> >             }
> >         }
> >         return -1;
> >     }
>
> The JimpleConstructorFolder creates a new statement from a number of old
> statements in the original source code. However, it does not copy the
> tags of the old statement to the new statement. It's not a bug, it's
> just that no one has implemented that functionality.
>
> If you need that functionality, you'll have to modify the
> JimpleConstructorFolder yourself so that when it creates a NewExpr, it
> will also copy the relevant LineNumberTag (sort of like what you have
> right now in your method, just that you add the tags to the new
> statement).
>
> Please send your patch back to the list so that it can be added to the
> Soot trunk for the next release!
>
> pat
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>


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


More information about the Soot-list mailing list