From 559dbe07ddec1fabc7d62148f2b91beba1cfd22f Mon Sep 17 00:00:00 2001 From: Dapeng Gao <31944689+dpgao@users.noreply.github.com> Date: Wed, 12 Jun 2024 15:20:29 +0100 Subject: [PATCH] libunwind: Allow untagged pc under benchmark ABI Under the benchmark ABI, when making a function call that never returns, the link register might contain an untagged capability generated by a previous function return (Recall that returning under the benchmark ABI involves clearing the LSB of the address, clearing the tag at the same time). --- libunwind/src/AddressSpace.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libunwind/src/AddressSpace.hpp b/libunwind/src/AddressSpace.hpp index 56e5de51e334..5ef584e7d3c1 100644 --- a/libunwind/src/AddressSpace.hpp +++ b/libunwind/src/AddressSpace.hpp @@ -247,7 +247,8 @@ class _LIBUNWIND_HIDDEN LocalAddressSpace { } bool isNull() const { return value == nullptr; } bool isValid() const { -#ifdef __CHERI_PURE_CAPABILITY__ +#if defined(__CHERI_PURE_CAPABILITY__) && \ + !defined(__ARM_MORELLO_PURECAP_BENCHMARK_ABI) return __builtin_cheri_tag_get(value); #else return !isNull();