Skip to content

Commit

Permalink
Improve documentation for codegen_offset
Browse files Browse the repository at this point in the history
  • Loading branch information
adpaco-aws committed May 26, 2022
1 parent 273c88e commit 24d5318
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions kani-compiler/src/codegen_cprover_gotoc/codegen/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -972,8 +972,17 @@ impl<'tcx> GotocCtx<'tcx> {
Stmt::block(vec![src_align_check, dst_align_check, overflow_check, copy_expr], loc)
}

/// Computes the offset from a pointer
/// https://doc.rust-lang.org/std/intrinsics/fn.offset.html
/// Computes the offset from a pointer.
///
/// Note that this function handles code generation for:
/// 1. The `offset` intrinsic.
/// https://doc.rust-lang.org/std/intrinsics/fn.offset.html
/// 2. The `arith_offset` intrinsic.
/// https://doc.rust-lang.org/std/intrinsics/fn.arith_offset.html
///
/// Note(std): We don't check that the starting or resulting pointer stay
/// within bounds of the object they point to. Doing so causes spurious
/// failures due to the usage of these intrinsics in the standard library.
fn codegen_offset(
&mut self,
intrinsic: &str,
Expand Down

0 comments on commit 24d5318

Please sign in to comment.