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
|
@ -199,7 +199,8 @@ impl<'gcc, 'tcx> ConstMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
|
|||
}
|
||||
}
|
||||
Scalar::Ptr(ptr, _size) => {
|
||||
let (alloc_id, offset) = ptr.into_parts();
|
||||
let (prov, offset) = ptr.into_parts(); // we know the `offset` is relative
|
||||
let alloc_id = prov.alloc_id();
|
||||
let base_addr =
|
||||
match self.tcx.global_alloc(alloc_id) {
|
||||
GlobalAlloc::Memory(alloc) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue