diff --git a/test/regression/memory.py b/test/regression/memory.py index 40599d044..9b26209f4 100644 --- a/test/regression/memory.py +++ b/test/regression/memory.py @@ -79,7 +79,7 @@ def __init__(self, address_range: range, flags: SegmentFlags, data: bytes): self.data = bytearray(data) if len(self.data) != len(address_range): - raise ValueError("Data length must be equal to the lenth of the address range") + raise ValueError("Data length must be equal to the length of the address range") def read(self, req: ReadRequest) -> ReadReply: return ReadReply(data=int.from_bytes(self.data[req.addr : req.addr + req.byte_count], "little")) @@ -149,6 +149,9 @@ def load_segment(segment: Segment, *, disable_write_protection: bool = False) -> data = segment.data() + # fill the rest of the segment with zeroes + data = data + b"\x00" * (seg_end - seg_start - len(data)) + flags = SegmentFlags(0) if flags_raw & P_FLAGS.PF_R: flags |= SegmentFlags.READ