Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Kani reject mutable pointer casts if padding is incompatible and memory initialization is checked #3332

Merged
Prev Previous commit
Next Next commit
Make clippy happy
  • Loading branch information
artemagvanian committed Jul 8, 2024
commit 9d6d9e75cb7b97128a385ee6ee362c178cc766c9
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,8 @@ fn try_resolve_instance(locals: &[LocalDecl], func: &Operand) -> Result<Instance
/// its size.
fn tys_layout_compatible(from_ty: &Ty, to_ty: &Ty) -> bool {
// Retrieve layouts to assess compatibility.
let from_ty_info = PointeeInfo::from_ty(from_ty.clone());
let to_ty_info = PointeeInfo::from_ty(to_ty.clone());
let from_ty_info = PointeeInfo::from_ty(*from_ty);
let to_ty_info = PointeeInfo::from_ty(*to_ty);
if let (Ok(from_ty_info), Ok(to_ty_info)) = (from_ty_info, to_ty_info) {
let from_ty_layout = match from_ty_info.layout() {
PointeeLayout::Sized { layout } => layout,
Expand Down
Loading