diff options
| author | Josh Watson <josh@trailofbits.com> | 2018-11-06 11:05:39 -0800 |
|---|---|---|
| committer | Jordan <jordan@psifertex.com> | 2018-11-06 15:21:45 -0500 |
| commit | fe2c9b2b16a1b4b97009c84b268ddd4c445faaa7 (patch) | |
| tree | 83a3b52e7db2eefd95d0d5a4c622458a0f243aae /python | |
| parent | 37694b9a1a95a8f876f09f21bceacbfd7abc6716 (diff) | |
Added __eq__ to MediumLevelILOperationAndSize as well
Diffstat (limited to 'python')
| -rw-r--r-- | python/mediumlevelil.py | 6 |
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): """ |
