summaryrefslogtreecommitdiff
path: root/python/mediumlevelil.py
diff options
context:
space:
mode:
authorJosh Watson <josh@joshwatson.com>2017-07-14 13:06:36 -0400
committerplafosse <peter.a.lafosse@gmail.com>2017-07-14 13:06:36 -0400
commitbb15b09b7888d238ab78d249fdf0e0c29999d9df (patch)
tree0ad75a5baa222c8581d57351361261587f3f7d05 /python/mediumlevelil.py
parent517cceed6b240242bdb541b875fffb27c91895cf (diff)
Added __hash__ and __eq__ to Variable and SSAVariable (#725)
Diffstat (limited to 'python/mediumlevelil.py')
-rw-r--r--python/mediumlevelil.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index 1274bd9b..1fdfab4b 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -36,6 +36,15 @@ class SSAVariable(object):
def __repr__(self):
return "<ssa %s version %d>" % (repr(self.var), self.version)
+ def __eq__(self, other):
+ return (
+ (self.var.identifier, self.version) ==
+ (other.var.identifier, other.version)
+ )
+
+ def __hash__(self):
+ return hash(self.var.identifier, self.version)
+
class MediumLevelILLabel(object):
def __init__(self, handle = None):