[Soot-list] Compare Value instances for equality
Eric Bodden
eric.bodden at sit.fraunhofer.de
Sun May 5 04:16:27 EDT 2013
Hi all.
Note that there's a wrapper EquivalentValue that maps equals to equivTo and the same for hashcode…
Eric
On 28.04.2013, at 13:14, Rohan Padhye <rohanpadhye at cse.iitb.ac.in> wrote:
> Hello Matteo,
>
> For atomic soot.Value subtypes such as soot.Local, you can use them
> directly in flow sets as you will always find unique references - Java's
> default behaviour for equals() is to test reference equality. The same
> can be said for SootClass, SootMethod and SootField as well I think.
>
> For more complex soot.Value types which are made up of multiple atomic
> Values (e.g. FieldRef or Expr), the expressions will be different
> objects when they appear in different statements even if they have the
> same operands/operators. These can be tested for structural equivalence
> using the EquivTo interface that Marc-Andre mentioned if you are doing
> something like common sub-expression elimination. Hence these classes
> may not be suitable for use in standard Java sets if you want to group
> expressions with common operands.
>
> Hope this clarifies your doubt.
>
> Regards,
> Rohan
>
> On 2013-04-27 18:02, Matteo Ceccarello wrote:
>> Hi all,
>>
>> I just started working with SOOT. I'm trying to perform a data flow
>> analysis using `soot.Value` instances as elements of the flow sets.
>> However
>> it seems that none of the classes that implement that interface
>> override
>> the method `equals`. Am I right?
>>
>> If so, how can I use `soot.Value` instances in my flow analysis?
>>
>> Thank you very much
>>
>> Matteo
>>
>> _______________________________________________
>> Soot-list mailing list
>> Soot-list at sable.mcgill.ca
>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
> --
> Regards,
> Rohan Padhye
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
--
Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Tel: +49 6151 16-75422 Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130505/54a400ef/attachment.bin
More information about the Soot-list
mailing list