[Soot-list] Bug with AnnotationGenerator

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Thu Aug 12 03:52:12 EDT 2010


>                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