Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build after #466 #500

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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