diff options
Diffstat (limited to 'libdl/libdl_cfi.cpp')
-rw-r--r-- | libdl/libdl_cfi.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libdl/libdl_cfi.cpp b/libdl/libdl_cfi.cpp index 1dd5b21cd..3b68fc7d3 100644 --- a/libdl/libdl_cfi.cpp +++ b/libdl/libdl_cfi.cpp @@ -44,7 +44,8 @@ extern "C" size_t __cfi_shadow_size() { } static uint16_t shadow_load(void* p) { - uintptr_t addr = reinterpret_cast<uintptr_t>(p); + // Untag the pointer to move it into the address space covered by the shadow. + uintptr_t addr = reinterpret_cast<uintptr_t>(untag_address(p)); uintptr_t ofs = CFIShadow::MemToShadowOffset(addr); if (ofs > CFIShadow::kShadowSize) return CFIShadow::kInvalidShadow; return *reinterpret_cast<uint16_t*>(shadow_base_storage.v + ofs); |