From 967354c3b9b0306785dde600ab6f851fe1418612 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 12 Dec 2019 16:44:24 +1030 Subject: csky: tidy csky_chars_to_number * csky-dis.c (csky_chars_to_number): Remove abort and unnecessary mask. --- opcodes/ChangeLog | 5 +++++ opcodes/csky-dis.c | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'opcodes') diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 2a44855..9e0d57b 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2019-12-12 Alan Modra + + * csky-dis.c (csky_chars_to_number): Remove abort and unnecessary + mask. + 2019-12-11 Alan Modra * arc-dis.c (BITS): Don't truncate high bits with shifts. diff --git a/opcodes/csky-dis.c b/opcodes/csky-dis.c index af830f3..d7ffb13 100644 --- a/opcodes/csky-dis.c +++ b/opcodes/csky-dis.c @@ -134,17 +134,15 @@ csky_get_mask (struct csky_opcode_info const *pinfo) static unsigned int csky_chars_to_number (unsigned char * buf, int n) { - if (n <= 0) - abort (); int i; unsigned int val = 0; if (dis_info.info->endian == BFD_ENDIAN_BIG) for (i = 0; i < n; i++) - val = val << 8 | (buf[i] & 0xff); + val = val << 8 | buf[i]; else for (i = n - 1; i >= 0; i--) - val = val << 8 | (buf[i] & 0xff); + val = val << 8 | buf[i]; return val; } -- cgit v1.1