summaryrefslogtreecommitdiff
path: root/python/mediumlevelil.py
diff options
context:
space:
mode:
authorJosh Watson <josh@trailofbits.com>2018-11-06 11:05:39 -0800
committerJordan <jordan@psifertex.com>2018-11-06 15:21:45 -0500
commitfe2c9b2b16a1b4b97009c84b268ddd4c445faaa7 (patch)
tree83a3b52e7db2eefd95d0d5a4c622458a0f243aae /python/mediumlevelil.py
parent37694b9a1a95a8f876f09f21bceacbfd7abc6716 (diff)
Added __eq__ to MediumLevelILOperationAndSize as well
Diffstat (limited to 'python/mediumlevelil.py')
-rw-r--r--python/mediumlevelil.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index 103d8c5f..f35b2e6e 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -71,6 +71,12 @@ class MediumLevelILOperationAndSize(object):
return "<%s>" % self.operation.name
return "<%s %d>" % (self.operation.name, self.size)
+ def __eq__(self, other):
+ if isinstance(other, MediumLevelILOperation):
+ return other == self.operation
+ if isinstance(other, MediumLevelILOperationAndSize):
+ return other.size == self.size and other.operation == self.operation
+
class MediumLevelILInstruction(object):
"""