Skip to content

Commit

Permalink
fix(precompile): fix overflow sub (#1299)
Browse files Browse the repository at this point in the history
  • Loading branch information
driftluo authored Aug 3, 2023
1 parent de44cf5 commit b56f57d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/executor/src/precompiles/modexp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ fn get_data(data: &[u8], mut start: usize, size: usize) -> Result<Integer, Preco
exit_status: ExitError::StackOverflow,
})?;

padded.extend(std::iter::repeat(0).take(size - (end - start)));
padded.extend(std::iter::repeat(0).take(size - (end.saturating_sub(start))));

Ok(Integer::from_digits(&padded, Order::MsfBe))
}
Expand Down

0 comments on commit b56f57d

Please sign in to comment.