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

Tony Yan yan at cse.ohio-state.edu
Fri Apr 26 13:17:25 EDT 2013


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

-- 
Dacong (Tony) Yan
Ph.D. Student
Computer Science and Engineering
The Ohio State University, Columbus
http://www.cse.ohio-state.edu/~yan


More information about the Soot-list mailing list