[Soot-list] Bug with AnnotationGenerator

Hal Hildebrand hal.hildebrand at gmail.com
Thu Aug 12 12:01:39 EDT 2010


again, thanks!

On Aug 12, 2010, at 12:52 AM, Eric Bodden wrote:

>>                annotationName = "L" + annotationName.replace('.','/');
>>                if (!annotationName.endsWith(";")) {
>>                        annotationName += ";";
>>                }
> 
> No I think that would be wrong. In particular, "L" and ";" act like
> brackets: you always have to add either both or none.
> 
>> Otherwise, I suspect some usages of the method would wind up with an erroneous trailing ";;".
> 
> I have now changed the code to the following:
> 
> 		annotationName = annotationName.replace('.','/');
> 		if(!annotationName.endsWith(";"))
> 			annotationName = "L" + annotationName + ';';
> 
> I think this should be fool proof.
> 
> 
>> 
>> 
>> BTW, is it possible to also get the fix in for emitting source annotations from the baf JasminClass?  The fix I use is to insert the following two lines at the very beginning of the soot.baf.JasminClass.emitInst(Inst) method:
>> 
>>        LineNumberTag lnTag = (LineNumberTag) inst.getTag("LineNumberTag");
>>        if(lnTag != null) emit(".line " + lnTag.getLineNumber());
> 
> Sure. I have now committed that too. Thanks!
> 
> Eric



More information about the Soot-list mailing list