generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 134
Open
Labels
Z-ContractsIssue related to code contractsIssue related to code contracts[C] BugThis is a bug. Something isn't working.This is a bug. Something isn't working.
Milestone
Description
Looking at the kani::internal::Pointer implementation for *mut T:
kani/library/kani/src/internal.rs
Lines 59 to 63 in 1491dd6
| impl<'a, T> Pointer<'a> for *mut T { | |
| type Inner = T; | |
| unsafe fn decouple_lifetime(&self) -> &'a Self::Inner { | |
| &**self as &'a T | |
| } |
This can trigger UB if the location pointed by *mut T does not contain a valid value of type T since it is converting it to a &T.
Converting *const T into &mut T and *mut T to &mut T is also unsafe, and may break aliasing rules.
Metadata
Metadata
Assignees
Labels
Z-ContractsIssue related to code contractsIssue related to code contracts[C] BugThis is a bug. Something isn't working.This is a bug. Something isn't working.