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/sh | |
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/sh')
-rw-r--r-- | src/sh/Gstep.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sh/Gstep.c b/src/sh/Gstep.c index 60d7ec2b..2c6a96c5 100644 --- a/src/sh/Gstep.c +++ b/src/sh/Gstep.c @@ -31,7 +31,7 @@ static int sh_handle_signal_frame (unw_cursor_t *cursor) { struct cursor *c = (struct cursor *) cursor; - int ret; + int i, ret; unw_word_t sc_addr, sp, sp_addr = c->dwarf.cfa; struct dwarf_loc sp_loc = DWARF_LOC (sp_addr, 0); @@ -63,6 +63,9 @@ sh_handle_signal_frame (unw_cursor_t *cursor) c->sigcontext_addr = sc_addr; + 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. */ |