diff options
| author | Ralf Jung <post@ralfj.de> | 2023-11-25 18:41:53 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-12-07 17:46:36 +0100 |
| commit | cb863033423d895c0530ab749e4a3bca494b5c27 (patch) | |
| tree | adea7e97f6421b3c59f62a6203157096ab801cd3 /compiler/rustc_codegen_gcc/src/common.rs | |
| parent | 85a4bd8f5873aa3ec5eb38baf63b89aa9bd21a7b (diff) | |
| download | rust-cb863033423d895c0530ab749e4a3bca494b5c27.tar.gz rust-cb863033423d895c0530ab749e4a3bca494b5c27.zip | |
ctfe interpreter: extend provenance so that it can track whether a pointer is immutable
Diffstat (limited to 'compiler/rustc_codegen_gcc/src/common.rs')
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/common.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_gcc/src/common.rs b/compiler/rustc_codegen_gcc/src/common.rs index 93fe27e547a..b7ddc410315 100644 --- a/compiler/rustc_codegen_gcc/src/common.rs +++ b/compiler/rustc_codegen_gcc/src/common.rs @@ -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) => { |
