Skip to content

Commit

Permalink
Skip setting memory value if the value vec is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
sorpaas authored May 11, 2021
1 parent 2a8a3e9 commit 19ade85
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ impl Memory {
value: &[u8],
target_size: Option<usize>
) -> Result<(), ExitFatal> {
if value.is_empty() {
return Ok(())
}

let target_size = target_size.unwrap_or(value.len());

if offset.checked_add(target_size)
Expand Down

0 comments on commit 19ade85

Please # to comment.