[Soot-list] Equality of SootMethod

Denis Bogdanas denis.bogdanas at gmail.com
Mon Jun 6 14:32:11 EDT 2016


I had the same question before. Some confusion might come because soot does
not distinguish between method declarations and method references. Both are
SootMethod. Yet both are managed by soot and "GENERALLY" there's one single
instance for any individual method signature. As long as you don't try to
instantiate SootMethod yourself, comparing them by == should be fine.

Yet in the code example above, if you call resolve() multiple time, I'm not
sure what will happen.


On 6 June 2016 at 06:28, Steven Arzt <Steven.Arzt at cased.de> wrote:

> There should actually only be one instance of every Soot method. The
> resolver checks whether the method is already resolved. If so, no new
> instance is generated.
>
>
>
> *Von:* soot-list-bounces at CS.McGill.CA [mailto:
> soot-list-bounces at CS.McGill.CA] *Im Auftrag von *Denis Bogdanas
> *Gesendet:* Samstag, 14. Mai 2016 03:54
> *An:* Simone Aonzo
> *Cc:* soot-list at CS.McGill.CA
> *Betreff:* Re: [Soot-list] Equality of SootMethod
>
>
>
> Actually my answer above is not right. I just encountered a new place
> where SootMethod is instantiated: inside SootMethodRefImpl.resolve().
>
> I agree, an equals() would be highly useful.
>
>
>
> On 12 May 2016 at 10:11, Denis Bogdanas <denis.bogdanas at gmail.com> wrote:
>
> I believe Scene has only one instance of SootMethod for every method.
> Plain == is enough. You are not supposed to instantiate SootMethod by
> yourself.
>
>
>
> On 12 May 2016 at 08:08, Simone Aonzo <simone.aonzo at gmail.com> wrote:
>
> Hi all,
>
> how can I check if two SootMethod are equals?
>
> There isn't an equals override in the source:
> https://github.com/Sable/soot/blob/develop/src/soot/SootMethod.java
>
> Have a nice day,
> Simone
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
>
>
>
> --
>
> Denis
>
>
>
>
> --
>
> Denis
>



-- 
Denis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20160606/3aa540e7/attachment.html 


More information about the Soot-list mailing list