ctfe interpreter: extend provenance so that it can track whether a pointer is immutable
This commit is contained in:
parent
85a4bd8f58
commit
cb86303342
38 changed files with 261 additions and 145 deletions
|
@ -290,7 +290,7 @@ macro_rules! impl_into_diagnostic_arg_through_debug {
|
|||
// These types have nice `Debug` output so we can just use them in diagnostics.
|
||||
impl_into_diagnostic_arg_through_debug! {
|
||||
AllocId,
|
||||
Pointer,
|
||||
Pointer<AllocId>,
|
||||
AllocRange,
|
||||
}
|
||||
|
||||
|
@ -323,7 +323,7 @@ pub enum UndefinedBehaviorInfo<'tcx> {
|
|||
/// Invalid metadata in a wide pointer
|
||||
InvalidMeta(InvalidMetaKind),
|
||||
/// Reading a C string that does not end within its allocation.
|
||||
UnterminatedCString(Pointer),
|
||||
UnterminatedCString(Pointer<AllocId>),
|
||||
/// Using a pointer after it got freed.
|
||||
PointerUseAfterFree(AllocId, CheckInAllocMsg),
|
||||
/// Used a pointer outside the bounds it is valid for.
|
||||
|
@ -350,11 +350,11 @@ pub enum UndefinedBehaviorInfo<'tcx> {
|
|||
/// Using a non-character `u32` as character.
|
||||
InvalidChar(u32),
|
||||
/// The tag of an enum does not encode an actual discriminant.
|
||||
InvalidTag(Scalar),
|
||||
InvalidTag(Scalar<AllocId>),
|
||||
/// Using a pointer-not-to-a-function as function pointer.
|
||||
InvalidFunctionPointer(Pointer),
|
||||
InvalidFunctionPointer(Pointer<AllocId>),
|
||||
/// Using a pointer-not-to-a-vtable as vtable pointer.
|
||||
InvalidVTablePointer(Pointer),
|
||||
InvalidVTablePointer(Pointer<AllocId>),
|
||||
/// Using a string that is not valid UTF-8,
|
||||
InvalidStr(std::str::Utf8Error),
|
||||
/// Using uninitialized data where it is not allowed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue