diff python/hexfile.py @ 251:6ed3d3a82a63

Added another c3 example. First import attempt
author Windel Bouwman
date Mon, 29 Jul 2013 20:23:13 +0200
parents f254b87258e6
children
line wrap: on
line diff
--- a/python/hexfile.py	Sun Jul 28 19:07:51 2013 +0200
+++ b/python/hexfile.py	Mon Jul 29 20:23:13 2013 +0200
@@ -102,10 +102,6 @@
 
     def check(self):
         self.regions.sort(key=lambda r: r.address)
-        if len(self.regions) > 1:
-            for r1, r2 in zip(self.regions[:-1], self.regions[1:]):
-                if r1.EndAddress > r2.address:
-                    raise HexFileException('Overlapping regions')
         change = True
         while change and len(self.regions) > 1:
             change = False
@@ -114,6 +110,8 @@
                     r1.addData(r2.data)
                     self.regions.remove(r2)
                     change = True
+                elif r1.EndAddress > r2.address:
+                    raise HexFileException('Overlapping regions')
 
     def merge(self, other):
         for r in other.regions: