accept undef in raw pointers, for consistency with integers
This commit is contained in:
parent
261faf3ce2
commit
fb8b1e3989
@ -312,12 +312,16 @@ impl<'rt, 'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ty::RawPtr(..) => {
|
ty::RawPtr(..) => {
|
||||||
// No undef allowed here. Eventually this should be consistent with
|
if self.const_mode {
|
||||||
// the integer types.
|
// Integers/floats in CTFE: For consistency with integers, we do not
|
||||||
let _ptr = try_validation!(value.to_scalar_ptr(),
|
// accept undef.
|
||||||
"undefined address in pointer", self.path);
|
let _ptr = try_validation!(value.to_scalar_ptr(),
|
||||||
let _meta = try_validation!(value.to_meta(),
|
"undefined address in raw pointer", self.path);
|
||||||
"uninitialized data in fat pointer metadata", self.path);
|
let _meta = try_validation!(value.to_meta(),
|
||||||
|
"uninitialized data in raw fat pointer metadata", self.path);
|
||||||
|
} else {
|
||||||
|
// Remain consistent with `usize`: Accept anything.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ if ty.is_box() || ty.is_region_ptr() => {
|
_ if ty.is_box() || ty.is_region_ptr() => {
|
||||||
// Handle fat pointers.
|
// Handle fat pointers.
|
||||||
|
Loading…
Reference in New Issue
Block a user