diff options
author | Alan Modra <amodra@gmail.com> | 2019-12-12 16:44:24 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2019-12-12 16:46:45 +1030 |
commit | 967354c3b9b0306785dde600ab6f851fe1418612 (patch) | |
tree | 6fa93106ea5ee402274c2ed2d95ea46e514065ac /opcodes | |
parent | 199d46bebbe66a3f60717d3aa3d7b7559680d40b (diff) | |
download | gdb-967354c3b9b0306785dde600ab6f851fe1418612.zip gdb-967354c3b9b0306785dde600ab6f851fe1418612.tar.gz gdb-967354c3b9b0306785dde600ab6f851fe1418612.tar.bz2 |
csky: tidy csky_chars_to_number
* csky-dis.c (csky_chars_to_number): Remove abort and unnecessary
mask.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 5 | ||||
-rw-r--r-- | opcodes/csky-dis.c | 6 |
2 files changed, 7 insertions, 4 deletions
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 <amodra@gmail.com> + + * csky-dis.c (csky_chars_to_number): Remove abort and unnecessary + mask. + 2019-12-11 Alan Modra <amodra@gmail.com> * 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; } |