summaryrefslogtreecommitdiff
path: root/src/third_party/unwind/dist/src/ptrace/_UPT_access_reg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/unwind/dist/src/ptrace/_UPT_access_reg.c')
-rw-r--r--src/third_party/unwind/dist/src/ptrace/_UPT_access_reg.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/third_party/unwind/dist/src/ptrace/_UPT_access_reg.c b/src/third_party/unwind/dist/src/ptrace/_UPT_access_reg.c
index ce25c783b04..0e247053f13 100644
--- a/src/third_party/unwind/dist/src/ptrace/_UPT_access_reg.c
+++ b/src/third_party/unwind/dist/src/ptrace/_UPT_access_reg.c
@@ -268,6 +268,16 @@ _UPT_access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val,
}
#endif /* End of IA64 */
+#if UNW_TARGET_RISCV
+ if (reg == UNW_RISCV_X0) {
+ if (write)
+ goto badreg;
+
+ *val = 0;
+ return 0;
+ }
+#endif /* End of RISCV */
+
if ((unsigned) reg >= ARRAY_SIZE (_UPT_reg_offset))
{
#if UNW_DEBUG