[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Annoyance in LineNumberTag class
Hi,
I found a quite annoying feature in the LineNumberTag class. Whenever
the line number goes beyond 127 the getValue() function returns
negative values. To my surprise when I looked at the source I found
this piece of code: LineNumbertag.java
public byte[] getValue()
{
byte[] v = new byte[2];
v[0] = (byte)(line_number/256);
v[1] = (byte)(line_number%256);
return v;
}
Since byte can't have a value more than 127, doing the above will lead to
overflow and negative numbers. Can't there be a function say
returnLineNumber() that returns the line number than having a construct
like the above? I feel that would be more useful since the line number is
stored as an int anyway.
Also regarding my previous post - supposing that I have many classes
within a java file and add the options -src-prec java and
-keep-line-number. Except for the main class I can't get the
SourceLnPosTag for the remaining classes. I would like to know if I missed
something or it's a feature that soot doesn't support yet. I would be
grateful for any response.
Thanks,
Ganeshan.