You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libunwind/714.patch

85 lines
3.5 KiB

From b22db9e003fb7b7a44533b91c811db76befb7528 Mon Sep 17 00:00:00 2001
From: Andrew Au <andrewau@microsoft.com>
Date: Wed, 24 Jan 2024 15:14:12 -0800
Subject: [PATCH 1/2] Fix issue #713
---
src/dwarf/Gget_proc_info_in_range.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/dwarf/Gget_proc_info_in_range.c b/src/dwarf/Gget_proc_info_in_range.c
index 5701c5d2d..65cc15139 100644
--- a/src/dwarf/Gget_proc_info_in_range.c
+++ b/src/dwarf/Gget_proc_info_in_range.c
@@ -58,8 +58,9 @@ unw_get_proc_info_in_range (unw_word_t start_ip,
if (eh_frame_table != 0) {
unw_accessors_t *a = unw_get_accessors_int (as);
- struct dwarf_eh_frame_hdr* exhdr = NULL;
- if ((*a->access_mem)(as, eh_frame_table, (unw_word_t*)&exhdr, 0, arg) < 0) {
+ struct dwarf_eh_frame_hdr exhdr1;
+ struct dwarf_eh_frame_hdr* exhdr = &exhdr1;
+ if ((*a->access_mem)(as, eh_frame_table, (unw_word_t*)exhdr, 0, arg) < 0) {
return -UNW_EINVAL;
}
From 3cbb4019c695dea2430186c1b19b0067a97a1422 Mon Sep 17 00:00:00 2001
From: Andrew Au <andrewau@microsoft.com>
Date: Fri, 26 Jan 2024 13:27:04 -0800
Subject: [PATCH 2/2] New version
---
src/dwarf/Gget_proc_info_in_range.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/dwarf/Gget_proc_info_in_range.c b/src/dwarf/Gget_proc_info_in_range.c
index 65cc15139..788aa7a13 100644
--- a/src/dwarf/Gget_proc_info_in_range.c
+++ b/src/dwarf/Gget_proc_info_in_range.c
@@ -58,14 +58,13 @@ unw_get_proc_info_in_range (unw_word_t start_ip,
if (eh_frame_table != 0) {
unw_accessors_t *a = unw_get_accessors_int (as);
- struct dwarf_eh_frame_hdr exhdr1;
- struct dwarf_eh_frame_hdr* exhdr = &exhdr1;
- if ((*a->access_mem)(as, eh_frame_table, (unw_word_t*)exhdr, 0, arg) < 0) {
+ struct dwarf_eh_frame_hdr exhdr;
+ if ((*a->access_mem)(as, eh_frame_table, (unw_word_t*)&exhdr, 0, arg) < 0) {
return -UNW_EINVAL;
}
- if (exhdr->version != DW_EH_VERSION) {
- Debug (1, "Unexpected version %d\n", exhdr->version);
+ if (exhdr.version != DW_EH_VERSION) {
+ Debug (1, "Unexpected version %d\n", exhdr.version);
return -UNW_EBADVERSION;
}
unw_word_t addr = eh_frame_table + offsetof(struct dwarf_eh_frame_hdr, eh_frame);
@@ -73,12 +72,12 @@ unw_get_proc_info_in_range (unw_word_t start_ip,
unw_word_t fde_count;
/* read eh_frame_ptr */
- if ((ret = dwarf_read_encoded_pointer(as, a, &addr, exhdr->eh_frame_ptr_enc, pi, &eh_frame_start, arg)) < 0) {
+ if ((ret = dwarf_read_encoded_pointer(as, a, &addr, exhdr.eh_frame_ptr_enc, pi, &eh_frame_start, arg)) < 0) {
return ret;
}
/* read fde_count */
- if ((ret = dwarf_read_encoded_pointer(as, a, &addr, exhdr->fde_count_enc, pi, &fde_count, arg)) < 0) {
+ if ((ret = dwarf_read_encoded_pointer(as, a, &addr, exhdr.fde_count_enc, pi, &fde_count, arg)) < 0) {
return ret;
}
@@ -88,8 +87,8 @@ unw_get_proc_info_in_range (unw_word_t start_ip,
return -UNW_ENOINFO;
}
- if (exhdr->table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)) {
- Debug (1, "Table encoding not supported %x\n", exhdr->table_enc);
+ if (exhdr.table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)) {
+ Debug (1, "Table encoding not supported %x\n", exhdr.table_enc);
return -UNW_EINVAL;
}