ctfe interpreter: extend provenance so that it can track whether a pointer is immutable
This commit is contained in:
@@ -381,7 +381,7 @@ impl<'tcx> Operand<'tcx> {
|
||||
impl<'tcx> ConstOperand<'tcx> {
|
||||
pub fn check_static_ptr(&self, tcx: TyCtxt<'_>) -> Option<DefId> {
|
||||
match self.const_.try_to_scalar() {
|
||||
Some(Scalar::Ptr(ptr, _size)) => match tcx.global_alloc(ptr.provenance) {
|
||||
Some(Scalar::Ptr(ptr, _size)) => match tcx.global_alloc(ptr.provenance.alloc_id()) {
|
||||
GlobalAlloc::Static(def_id) => {
|
||||
assert!(!tcx.is_thread_local_static(def_id));
|
||||
Some(def_id)
|
||||
|
||||
Reference in New Issue
Block a user