diff options
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/unwind-dw2-fde-darwin.c | 5 | ||||
-rw-r--r-- | gcc/unwind-dw2-fde-glibc.c | 6 | ||||
-rw-r--r-- | gcc/unwind-dw2-fde.c | 4 | ||||
-rw-r--r-- | gcc/unwind-dw2.c | 23 |
5 files changed, 37 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5e2d4de..3bd6777 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2005-06-14 Nathan Sidwell <nathan@codesourcery.com> + + * unwind-dw2-fde-darwin.c (examine_objects): Fix aliasing in + read_encoded_value_with_base call. + * unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Likewise. + * unwind-dw2-fde.c (_Unwind_Find_FDE): Likewise. + * unwind-dw2.c (extract_cie_info): Fix aliasing in + read_encoded_value call. + (execute_cfa_program, uw_frame_state_for): Likewise. + 2005-06-13 Roger Sayle <roger@eyesopen.com> PR rtl-optimization/22053 diff --git a/gcc/unwind-dw2-fde-darwin.c b/gcc/unwind-dw2-fde-darwin.c index c0db8e1..f242654 100644 --- a/gcc/unwind-dw2-fde-darwin.c +++ b/gcc/unwind-dw2-fde-darwin.c @@ -220,6 +220,7 @@ examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc) if (result) { int encoding; + _Unwind_Ptr func; bases->tbase = ob->tbase; bases->dbase = ob->dbase; @@ -229,8 +230,8 @@ examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc) encoding = get_fde_encoding (result); read_encoded_value_with_base (encoding, base_from_object (encoding, ob), - result->pc_begin, - (_Unwind_Ptr *)&bases->func); + result->pc_begin, &func); + bases->func = (void *) func; break; } } diff --git a/gcc/unwind-dw2-fde-glibc.c b/gcc/unwind-dw2-fde-glibc.c index 306afdd..ebc2d9c 100644 --- a/gcc/unwind-dw2-fde-glibc.c +++ b/gcc/unwind-dw2-fde-glibc.c @@ -386,11 +386,13 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr) data->ret = linear_search_fdes (&ob, (fde *) eh_frame, (void *) data->pc); if (data->ret != NULL) { + _Unwind_Ptr func; unsigned int encoding = get_fde_encoding (data->ret); + read_encoded_value_with_base (encoding, base_from_cb_data (encoding, data), - data->ret->pc_begin, - (_Unwind_Ptr *)&data->func); + data->ret->pc_begin, &func); + data->func = (void *) func; } return 1; } diff --git a/gcc/unwind-dw2-fde.c b/gcc/unwind-dw2-fde.c index df9eafe..d6b3a58 100644 --- a/gcc/unwind-dw2-fde.c +++ b/gcc/unwind-dw2-fde.c @@ -1013,6 +1013,7 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases) if (f) { int encoding; + _Unwind_Ptr func; bases->tbase = ob->tbase; bases->dbase = ob->dbase; @@ -1021,7 +1022,8 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases) if (ob->s.b.mixed_encoding) encoding = get_fde_encoding (f); read_encoded_value_with_base (encoding, base_from_object (encoding, ob), - f->pc_begin, (_Unwind_Ptr *)&bases->func); + f->pc_begin, &func); + bases->func = (void *) func; } return f; diff --git a/gcc/unwind-dw2.c b/gcc/unwind-dw2.c index b50ae01..55764fe 100644 --- a/gcc/unwind-dw2.c +++ b/gcc/unwind-dw2.c @@ -320,8 +320,10 @@ extract_cie_info (const struct dwarf_cie *cie, struct _Unwind_Context *context, /* "P" indicates a personality routine in the CIE augmentation. */ else if (aug[0] == 'P') { - p = read_encoded_value (context, *p, p + 1, - (_Unwind_Ptr *) &fs->personality); + _Unwind_Ptr personality; + + p = read_encoded_value (context, *p, p + 1, &personality); + fs->personality = (_Unwind_Personality_Fn) personality; aug += 1; } @@ -785,8 +787,13 @@ execute_cfa_program (const unsigned char *insn_ptr, else switch (insn) { case DW_CFA_set_loc: - insn_ptr = read_encoded_value (context, fs->fde_encoding, - insn_ptr, (_Unwind_Ptr *) &fs->pc); + { + _Unwind_Ptr pc; + + insn_ptr = read_encoded_value (context, fs->fde_encoding, + insn_ptr, &pc); + fs->pc = (void *) pc; + } break; case DW_CFA_advance_loc1: @@ -1001,8 +1008,12 @@ uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs) insn = aug + i; } if (fs->lsda_encoding != DW_EH_PE_omit) - aug = read_encoded_value (context, fs->lsda_encoding, aug, - (_Unwind_Ptr *) &context->lsda); + { + _Unwind_Ptr lsda; + + aug = read_encoded_value (context, fs->lsda_encoding, aug, &lsda); + context->lsda = (void *) lsda; + } /* Then the insns in the FDE up to our target PC. */ if (insn == NULL) |