summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAaron Robinson <arobins@microsoft.com>2022-03-16 19:47:28 -0700
committerDave Watson <dade.watson@gmail.com>2022-05-22 10:58:11 -0700
commit28ca328b0b34bb0d08ebf0f173b191f3f4ee9e23 (patch)
tree5151024d751c6f10e71f39b91a572cbaa59bf0e2 /src
parenta9d50ef5066e8ff959dee5df5f997cc72c528f26 (diff)
downloadlibunwind-28ca328b0b34bb0d08ebf0f173b191f3f4ee9e23.tar.gz
Fix issues with 4701
Diffstat (limited to 'src')
-rw-r--r--src/dwarf/Gfind_proc_info-lsb.c6
-rw-r--r--src/dwarf/Gparser.c3
-rw-r--r--src/x86_64/Gstep.c4
3 files changed, 7 insertions, 6 deletions
diff --git a/src/dwarf/Gfind_proc_info-lsb.c b/src/dwarf/Gfind_proc_info-lsb.c
index 824e9eb9..8274733e 100644
--- a/src/dwarf/Gfind_proc_info-lsb.c
+++ b/src/dwarf/Gfind_proc_info-lsb.c
@@ -910,15 +910,15 @@ dwarf_search_unwind_table (unw_addr_space_t as, unw_word_t ip,
unw_dyn_info_t *di, unw_proc_info_t *pi,
int need_unwind_info, void *arg)
{
- const struct table_entry *e = NULL, *table;
+ const struct table_entry *e = NULL, *table = NULL;
unw_word_t ip_base = 0, segbase = 0, last_ip, fde_addr;
unw_accessors_t *a;
#ifndef UNW_LOCAL_ONLY
struct table_entry ent;
#endif
int ret;
- unw_word_t debug_frame_base;
- size_t table_len;
+ unw_word_t debug_frame_base = 0;
+ size_t table_len = 0;
#ifdef UNW_REMOTE_ONLY
assert (is_remote_table(di->format));
diff --git a/src/dwarf/Gparser.c b/src/dwarf/Gparser.c
index 7abf199c..66976dcb 100644
--- a/src/dwarf/Gparser.c
+++ b/src/dwarf/Gparser.c
@@ -994,7 +994,7 @@ apply_reg_state (struct dwarf_cursor *c, struct dwarf_reg_state *rs)
static int
find_reg_state (struct dwarf_cursor *c, dwarf_state_record_t *sr)
{
- dwarf_reg_state_t *rs;
+ dwarf_reg_state_t *rs = NULL;
struct dwarf_rs_cache *cache;
int ret = 0;
intrmask_t saved_mask;
@@ -1070,6 +1070,7 @@ dwarf_make_proc_info (struct dwarf_cursor *c)
args_size, and set cursor appropriately. Only
needed for unw_resume */
dwarf_state_record_t sr;
+ sr.args_size = 0;
int ret;
/* Lookup it up the slow way... */
diff --git a/src/x86_64/Gstep.c b/src/x86_64/Gstep.c
index fdad298c..4216d188 100644
--- a/src/x86_64/Gstep.c
+++ b/src/x86_64/Gstep.c
@@ -112,7 +112,7 @@ unw_step (unw_cursor_t *cursor)
unw_word_t invalid_prev_rip = 0;
unw_word_t prev_ip = c->dwarf.ip, prev_cfa = c->dwarf.cfa;
- struct dwarf_loc rbp_loc, rsp_loc, rip_loc;
+ struct dwarf_loc rbp_loc = DWARF_NULL_LOC, rsp_loc = DWARF_NULL_LOC, rip_loc = DWARF_NULL_LOC;
/* We could get here because of missing/bad unwind information.
Validate all addresses before dereferencing. */
@@ -253,7 +253,7 @@ unw_step (unw_cursor_t *cursor)
}
/* Mark all registers unsaved */
for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i)
- c->dwarf.loc[i] = DWARF_NULL_LOC;
+ c->dwarf.loc[i] = DWARF_NULL_LOC;
c->dwarf.loc[RBP] = rbp_loc;
c->dwarf.loc[RSP] = rsp_loc;