diff options
author | Jameson Nash <vtjnash@gmail.com> | 2022-04-25 18:30:37 -0400 |
---|---|---|
committer | Dave Watson <dade.watson@gmail.com> | 2022-05-22 11:10:44 -0700 |
commit | 0c4484911dcaa47af09da3a717a66ab98dc7f7a8 (patch) | |
tree | 433b34c181e661e759ed3cc7e94e0d11a3908a2f /src/loongarch64 | |
parent | 7eb6f72ff22a8db41800a317d331750982f75296 (diff) | |
download | libunwind-0c4484911dcaa47af09da3a717a66ab98dc7f7a8.tar.gz |
avoid leaking registers across sigreturn
Mostly just relevant for fp registers, which are frequently mostly just
ignored otherwise.
Diffstat (limited to 'src/loongarch64')
-rw-r--r-- | src/loongarch64/Gstep.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/loongarch64/Gstep.c b/src/loongarch64/Gstep.c index 5743694b..221cc4f1 100644 --- a/src/loongarch64/Gstep.c +++ b/src/loongarch64/Gstep.c @@ -33,7 +33,7 @@ loongarch64_handle_signal_frame (unw_cursor_t *cursor) struct cursor *c = (struct cursor *) cursor; unw_word_t sc_addr, sp_addr = c->dwarf.cfa; unw_word_t ra, fp; - int ret; + int i, ret; if (unw_is_signal_frame (cursor)) { sc_addr = sp_addr + LINUX_SF_TRAMP_SIZE + sizeof (siginfo_t) + @@ -51,6 +51,9 @@ loongarch64_handle_signal_frame (unw_cursor_t *cursor) c->sigcontext_pc = c->dwarf.ip; c->sigcontext_format = LOONGARCH64_SCF_LINUX_RT_SIGFRAME; + for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + /* Update the dwarf cursor. Set the location of the registers to the corresponding addresses of the uc_mcontext / sigcontext structure contents. */ |