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

Patrick Lam plam at sable.mcgill.ca
Mon Apr 9 19:11:56 EDT 2007


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


More information about the Soot-list mailing list