[Soot-list] getThisLocal(), CHA on soot.Main

Patrick LAM plam at sable.mcgill.ca
Fri Oct 8 13:45:52 EDT 2004


On Thu, 7 Oct 2004, Saswat Anand wrote:

> I see that Body : getThisLocal() throws an exception when there is no
> "this", like in case of static methods. I think it would be nicer if it just
> returns null instead throwing an exception!

It would perhaps be better to not call getThisLocal when that doesn't
exist; that can't possibly be sensible.  Returning null is just a good way
to mask problems.

> Secondly, CHA based call graph construction crashes when applied to
> soot.Main. This is soot2.1 -- so the problem may have been fixed in the CVS?

Do you have steps to reproduce this bug?

> Also, Transform : setDeclaredOptions( java.lang.String ) and Transform :
> setDefaultOptions( java.lang.String ) do not seem to have much
> documentation. Only after some hit and trial I realized that if I have more
> that one option to declare for my phase, they should be separated by a
> space, like setDeclaredOptions( "option1 option2" )!  Same goes for
> setDefaultOptions(). A more suggestive name for setDeclaredOptions might be
> declareOptions().

declareOptions() would tend to be inconsistent with the getX/setX
convention that we use throughout Soot.  I have committed a change to the
javadoc in Transform that indicates what these methods are supposed to do,
though.

pat






More information about the Soot-list mailing list