[Soot-list] Equality of SootMethod

Steven Arzt Steven.Arzt at cased.de
Tue Jun 7 03:41:53 EDT 2016


Almost right. A method reference is a SootMethodRef. Only when this reference is resolved, it points to a method definition, i.e., a SootMethod. There can be multiple references pointing to the same method declaration, sure. Still, there is only one declaration for that particular method.

 

Von: Denis Bogdanas [mailto:denis.bogdanas at gmail.com] 
Gesendet: Montag, 6. Juni 2016 20:32
An: Steven Arzt
Cc: Simone Aonzo; soot-list at CS.McGill.CA
Betreff: Re: [Soot-list] Equality of SootMethod

 

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/20160607/51824453/attachment-0001.html 


More information about the Soot-list mailing list