Skip to content

Commit

Permalink
avoid possible overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
edg-l committed Oct 17, 2024
1 parent 482438b commit ad9f29e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ pub unsafe extern "C" fn cairo_native__dict_get(
#[no_mangle]
pub unsafe extern "C" fn cairo_native__dict_gas_refund(ptr: *const FeltDict) -> u64 {
let dict = &*ptr;
(dict.count - dict.inner.len() as u64) * *DICT_GAS_REFUND_PER_ACCESS
(dict.count.saturating_sub(dict.inner.len() as u64)) * *DICT_GAS_REFUND_PER_ACCESS
}

/// Compute `ec_point_from_x_nz(x)` and store it.
Expand Down

0 comments on commit ad9f29e

Please sign in to comment.