[Soot-list] bug in Scene.getSootClass()?

Marc-André Laverdière-Papineau marc-andre.laverdiere-papineau at polymtl.ca
Fri Apr 26 21:18:30 EDT 2013


Hello Tony,

I looked at the execution path and I can confirm what you reported.

Do you have a test that shows the issue? It would be nice to start 
having some kind regression testing :)

If you wish, you could write the patch and/or put the issue on Github. 
That would leave the credit to you.

Otherwise, I can make a pull request for that tomorrow.

Marc-André Laverdière-Papineau
Doctorant - PhD Candidate

On 04/26/2013 01:17 PM, Tony Yan wrote:
> Hi,
>
> There's likely to be a bug in Scene.getSootClass() on handling of
> phantom classes:
>
>    if (allowsPhantomRefs() ||
> 				   className.equals(SootClass.INVOKEDYNAMIC_DUMMY_CLASS_NAME)) {
> 	SootClass c = new SootClass(className);
> 	c.setPhantom(true);
> 	addClass(c);
> 	return c;
>    }
>
> addClass(c) would contains a call c.setLibraryClass() which does
> c.setPhantom(false). Thus, the returned class is falsely flagged as
> non-phantom. A fix is to re-order the two calls:
> 	addClass(c);
> 	c.setPhantom(true);
>
> Thanks,
> Tony
>


More information about the Soot-list mailing list