Commit 950ccbc4 by Nathan Sidwell Committed by Nathan Sidwell

unwind-dw2-fde-darwin.c (examine_objects): Fix aliasing in read_encoded_value_with_base call.

	* 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.

From-SVN: r100927
parent 6f7e2c0c
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> 2005-06-13 Roger Sayle <roger@eyesopen.com>
PR rtl-optimization/22053 PR rtl-optimization/22053
......
...@@ -220,6 +220,7 @@ examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc) ...@@ -220,6 +220,7 @@ examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc)
if (result) if (result)
{ {
int encoding; int encoding;
_Unwind_Ptr func;
bases->tbase = ob->tbase; bases->tbase = ob->tbase;
bases->dbase = ob->dbase; bases->dbase = ob->dbase;
...@@ -229,8 +230,8 @@ examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc) ...@@ -229,8 +230,8 @@ examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc)
encoding = get_fde_encoding (result); encoding = get_fde_encoding (result);
read_encoded_value_with_base (encoding, read_encoded_value_with_base (encoding,
base_from_object (encoding, ob), base_from_object (encoding, ob),
result->pc_begin, result->pc_begin, &func);
(_Unwind_Ptr *)&bases->func); bases->func = (void *) func;
break; break;
} }
} }
......
...@@ -386,11 +386,13 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr) ...@@ -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); data->ret = linear_search_fdes (&ob, (fde *) eh_frame, (void *) data->pc);
if (data->ret != NULL) if (data->ret != NULL)
{ {
_Unwind_Ptr func;
unsigned int encoding = get_fde_encoding (data->ret); unsigned int encoding = get_fde_encoding (data->ret);
read_encoded_value_with_base (encoding, read_encoded_value_with_base (encoding,
base_from_cb_data (encoding, data), base_from_cb_data (encoding, data),
data->ret->pc_begin, data->ret->pc_begin, &func);
(_Unwind_Ptr *)&data->func); data->func = (void *) func;
} }
return 1; return 1;
} }
......
...@@ -1013,6 +1013,7 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases) ...@@ -1013,6 +1013,7 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
if (f) if (f)
{ {
int encoding; int encoding;
_Unwind_Ptr func;
bases->tbase = ob->tbase; bases->tbase = ob->tbase;
bases->dbase = ob->dbase; bases->dbase = ob->dbase;
...@@ -1021,7 +1022,8 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases) ...@@ -1021,7 +1022,8 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
if (ob->s.b.mixed_encoding) if (ob->s.b.mixed_encoding)
encoding = get_fde_encoding (f); encoding = get_fde_encoding (f);
read_encoded_value_with_base (encoding, base_from_object (encoding, ob), 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; return f;
......
...@@ -320,8 +320,10 @@ extract_cie_info (const struct dwarf_cie *cie, struct _Unwind_Context *context, ...@@ -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. */ /* "P" indicates a personality routine in the CIE augmentation. */
else if (aug[0] == 'P') else if (aug[0] == 'P')
{ {
p = read_encoded_value (context, *p, p + 1, _Unwind_Ptr personality;
(_Unwind_Ptr *) &fs->personality);
p = read_encoded_value (context, *p, p + 1, &personality);
fs->personality = (_Unwind_Personality_Fn) personality;
aug += 1; aug += 1;
} }
...@@ -785,8 +787,13 @@ execute_cfa_program (const unsigned char *insn_ptr, ...@@ -785,8 +787,13 @@ execute_cfa_program (const unsigned char *insn_ptr,
else switch (insn) else switch (insn)
{ {
case DW_CFA_set_loc: case DW_CFA_set_loc:
{
_Unwind_Ptr pc;
insn_ptr = read_encoded_value (context, fs->fde_encoding, insn_ptr = read_encoded_value (context, fs->fde_encoding,
insn_ptr, (_Unwind_Ptr *) &fs->pc); insn_ptr, &pc);
fs->pc = (void *) pc;
}
break; break;
case DW_CFA_advance_loc1: case DW_CFA_advance_loc1:
...@@ -1001,8 +1008,12 @@ uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs) ...@@ -1001,8 +1008,12 @@ uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs)
insn = aug + i; insn = aug + i;
} }
if (fs->lsda_encoding != DW_EH_PE_omit) 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. */ /* Then the insns in the FDE up to our target PC. */
if (insn == NULL) if (insn == NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment