layers: Ensure the new registry check doesn't throw an exception.

This commit is contained in:
Mike Auty
2019-11-12 09:09:51 +00:00
committed by ikelos
parent face38436e
commit d0a5d4ba3f
+8 -7
View File
@@ -227,13 +227,14 @@ class RegistryHive(linear.LinearlyMappedLayer):
def is_valid(self, offset: int, length: int = 1) -> bool:
"""Returns a boolean based on whether the offset is valid or not."""
# TODO: Fix me
# Pass this to the lower layers for now
return all([
self.context.layers[layer].is_valid(offset, length)
for (_, offset, length, layer) in self.mapping(offset, length)
])
try:
# Pass this to the lower layers for now
return all([
self.context.layers[layer].is_valid(offset, length)
for (_, offset, length, layer) in self.mapping(offset, length)
])
except exceptions.InvalidAddressException:
return False
@property
def minimum_address(self) -> int: