Fix potentially illegal shift and assign operation in CSKY disassembler.
* csky-dis.c (csky_chars_to_number): Check for a negative count. Use an unsigned integer to construct the return value.
This commit is contained in:
parent
bbf9a0b5ee
commit
1ee3542c0a
|
@ -1,3 +1,8 @@
|
||||||
|
2019-10-28 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
* csky-dis.c (csky_chars_to_number): Check for a negative
|
||||||
|
count. Use an unsigned integer to construct the return value.
|
||||||
|
|
||||||
2019-10-28 Nick Clifton <nickc@redhat.com>
|
2019-10-28 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* tic30-dis.c (OPERAND_BUFFER_LEN): Define. Use as length of
|
* tic30-dis.c (OPERAND_BUFFER_LEN): Define. Use as length of
|
||||||
|
|
|
@ -134,10 +134,10 @@ csky_get_mask (struct csky_opcode_info const *pinfo)
|
||||||
static unsigned int
|
static unsigned int
|
||||||
csky_chars_to_number (unsigned char * buf, int n)
|
csky_chars_to_number (unsigned char * buf, int n)
|
||||||
{
|
{
|
||||||
if (n == 0)
|
if (n <= 0)
|
||||||
abort ();
|
abort ();
|
||||||
int i;
|
int i;
|
||||||
int val = 0;
|
unsigned int val = 0;
|
||||||
|
|
||||||
if (dis_info.info->endian == BFD_ENDIAN_BIG)
|
if (dis_info.info->endian == BFD_ENDIAN_BIG)
|
||||||
while (n--)
|
while (n--)
|
||||||
|
|
Loading…
Reference in New Issue