Skip to content

Commit

Permalink
Fix set memory indexing.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomusdrw committed Jan 12, 2025
1 parent f7c5f3f commit 394de82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assembly/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export function setMemory(address: u32, data: Uint8Array): void {
const end = address + data.length;
for (let i = address; i < end; i++) {
// TODO [ToDr] handle page fault?
int.memory.setU8(i, data[i]);
int.memory.setU8(i, data[i - address]);
}
}

Expand Down

0 comments on commit 394de82

Please sign in to comment.