Skip to content

Commit

Permalink
update cur_memory_word_size zero
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamWuGit committed Jun 7, 2024
1 parent bd725c4 commit 695afd3
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,13 @@ mod tests {
};

let gas_cost = gas_cost.unwrap_or_else(|| {
let cur_memory_word_size = (src_offset + 31) / 32;
let next_memory_word_size = std::cmp::max((dst_offset + copy_size + 31) / 32,
cur_memory_word_size);
// no memory operation before mcopy
let cur_memory_word_size = 0;
let next_memory_word_size = if copy_size == 0 {
cur_memory_word_size
} else {
(std::cmp::max(src_offset, dst_offset) + copy_size + 31) / 32
};

OpcodeId::PUSH32.constant_gas_cost().0 * 3
+ memory_copier_gas_cost(
Expand Down

0 comments on commit 695afd3

Please sign in to comment.