Project

General

Profile

Bug #18121 ยป ruby-addr2line-endianness.patch

xtkoba (Tee KOBAYASHI), 08/19/2021 04:50 PM

View differences:

addr2line.c
871 871
    int type;
872 872
} DebugInfoValue;
873 873

  
874
/* TODO: Big Endian */
874
#ifdef WORDS_BIGENDIAN
875
#define MERGE_2INTS(a,b,sz) (((uint64_t)(a)<<sz)|(b))
876
#else
875 877
#define MERGE_2INTS(a,b,sz) (((uint64_t)(b)<<sz)|(a))
878
#endif
876 879

  
877 880
static uint16_t
878 881
get_uint16(const uint8_t *p)
......
913 916
{
914 917
    const char *p = *ptr;
915 918
    *ptr = (p + 3);
919
#ifdef WORDS_BIGENDIAN
916 920
    return ((uint8_t)*p << 16) | get_uint16((const uint8_t *)p+1);
921
#else
922
    return (*(uint8_t *)(p+2) << 16) | get_uint16((const uint8_t *)p);
923
#endif
917 924
}
918 925

  
919 926
static uint32_t