m1n1.utils: fix RegMap range lookup

Signed-off-by: Janne Grunau <j@jannau.net>
This commit is contained in:
Janne Grunau 2021-06-17 21:15:55 +02:00 committed by Hector Martin
parent cb6d1f58a2
commit ccd765464d

View file

@ -586,8 +586,8 @@ class RegMap(Reloadable, metaclass=RegMeta):
ret = cls._rngmap[offset]
if ret:
for rng, name, rcls in ret:
if reg in rng:
return name, rng.index(reg), rcls
if offset in rng:
return name, rng.index(offset), rcls
return None, None, None
def lookup_addr(self, addr):