Skip to content

Commit

Permalink
Store size when call store_bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed May 28, 2024
1 parent 62c55a5 commit b915850
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/snapshot2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,12 @@ impl<I: Clone + PartialEq, D: DataSource<I>> Snapshot2Context<I, D> {
id: &I,
offset: u64,
length: u64,
size_addr: u64,
) -> Result<(u64, u64), Error> {
let (data, full_length) = self.load_data(id, offset, length)?;
machine
.memory_mut()
.store64(&M::REG::from_u64(size_addr), &M::REG::from_u64(full_length))?;
self.untrack_pages(machine, addr, data.len() as u64)?;
machine.memory_mut().store_bytes(addr, &data)?;
self.track_pages(machine, addr, data.len() as u64, id, offset)?;
Expand Down

0 comments on commit b915850

Please sign in to comment.