Skip to content

Commit

Permalink
Fix build (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
tilk authored Nov 2, 2023
1 parent d6b59ee commit 65832ed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/regression/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 65832ed

Please sign in to comment.