mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-10-31 23:29:26 +01:00
[dwarf] The sword() function in Gexpr.c doesn't do what's intended.
Yes, it casts to signed, but then converts right back to unsigned via the return type. Fixed thus. Signed-off-by: Richard Henderson <rth@redhat.com> Signed-off-by: Arun Sharma <arun.sharma@google.com>
This commit is contained in:
parent
cdb96f333c
commit
11ea1275bd
5 changed files with 5 additions and 12 deletions
|
@ -45,6 +45,7 @@ extern "C" {
|
|||
#define UNW_TDEP_CURSOR_LEN 511
|
||||
|
||||
typedef uint32_t unw_word_t;
|
||||
typedef int32_t unw_sword_t;
|
||||
|
||||
typedef union
|
||||
{
|
||||
|
|
|
@ -67,6 +67,7 @@ extern "C" {
|
|||
#define UNW_PI_FLAG_IA64_RBS_SWITCH (1 << UNW_PI_FLAG_IA64_RBS_SWITCH_BIT)
|
||||
|
||||
typedef uint64_t unw_word_t;
|
||||
typedef int64_t unw_sword_t;
|
||||
|
||||
/* On IA-64, we want to access the contents of floating-point
|
||||
registers as a pair of "words", but to ensure 16-byte alignment, we
|
||||
|
|
|
@ -46,6 +46,7 @@ extern "C" {
|
|||
#define UNW_TDEP_CURSOR_LEN 127
|
||||
|
||||
typedef uint32_t unw_word_t;
|
||||
typedef int32_t unw_sword_t;
|
||||
|
||||
typedef long double unw_tdep_fpreg_t;
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ extern "C" {
|
|||
#define UNW_TDEP_CURSOR_LEN 127
|
||||
|
||||
typedef uint64_t unw_word_t;
|
||||
typedef int64_t unw_sword_t;
|
||||
|
||||
typedef long double unw_tdep_fpreg_t;
|
||||
|
||||
|
|
|
@ -106,18 +106,7 @@ static uint8_t operands[256] =
|
|||
[DW_OP_call_ref] = OPND1 (OFFSET)
|
||||
};
|
||||
|
||||
static inline unw_word_t
|
||||
sword (unw_word_t val)
|
||||
{
|
||||
switch (sizeof (unw_word_t))
|
||||
{
|
||||
case 1: return (int8_t) val;
|
||||
case 2: return (int16_t) val;
|
||||
case 4: return (int32_t) val;
|
||||
case 8: return (int64_t) val;
|
||||
default: abort ();
|
||||
}
|
||||
}
|
||||
#define sword(X) ((unw_sword_t) (X))
|
||||
|
||||
static inline unw_word_t
|
||||
read_operand (unw_addr_space_t as, unw_accessors_t *a,
|
||||
|
|
Loading…
Reference in a new issue