Miri function identity hack: account for possible inlining

This commit is contained in:
Ralf Jung 2024-07-02 21:05:22 +02:00
parent 7d97c59438
commit 41b98da42d
14 changed files with 80 additions and 47 deletions

View file

@ -745,7 +745,7 @@ fn mutability<'tcx>(ecx: &InterpCx<'tcx, impl Machine<'tcx>>, alloc_id: AllocId)
}
}
GlobalAlloc::Memory(alloc) => alloc.inner().mutability,
GlobalAlloc::Function(..) | GlobalAlloc::VTable(..) => {
GlobalAlloc::Function { .. } | GlobalAlloc::VTable(..) => {
// These are immutable, we better don't allow mutable pointers here.
Mutability::Not
}