about summary refs log tree commit diff stats
path: root/miasm2/core/interval.py
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2017-02-22 16:40:43 +0100
committerGitHub <noreply@github.com>2017-02-22 16:40:43 +0100
commit464519ca327b331c6fcc8c31408145f1192f1399 (patch)
tree8aebcfe67057d57af0208608edc6a88c3a85dd3d /miasm2/core/interval.py
parent688d21da608c32da84e093316ab32a4fa7fc51c8 (diff)
parentf9292fe7960cbdd6dbbd51b61966f3e43f3fff13 (diff)
downloadmiasm-464519ca327b331c6fcc8c31408145f1192f1399.tar.gz
miasm-464519ca327b331c6fcc8c31408145f1192f1399.zip
Merge pull request #496 from commial/feature/expr_range
Feature/expr range
Diffstat (limited to '')
-rw-r--r--miasm2/core/interval.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/miasm2/core/interval.py b/miasm2/core/interval.py
index 66445674..019764d4 100644
--- a/miasm2/core/interval.py
+++ b/miasm2/core/interval.py
@@ -244,3 +244,11 @@ class interval(object):
 
         if dry_run is False:
             img.show()
+
+    @property
+    def length(self):
+        """
+        Return the cumulated length of intervals
+        """
+        # Do not use __len__ because we may return a value > 32 bits
+        return sum((stop - start + 1) for start, stop in self.intervals)