aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-05-26 12:44:52 +0200
committerJan Beulich <jbeulich@suse.com>2023-05-26 12:44:52 +0200
commit93497bf9ab13a3d2aa06ff329155beca23e323fa (patch)
tree531a88ddf5dc2cafb325156a8c911c0369fb8b22 /opcodes
parenta3b86780b6cc9d5915a781bef0d901dcc5d9c07f (diff)
downloadfsf-binutils-gdb-93497bf9ab13a3d2aa06ff329155beca23e323fa.zip
fsf-binutils-gdb-93497bf9ab13a3d2aa06ff329155beca23e323fa.tar.gz
fsf-binutils-gdb-93497bf9ab13a3d2aa06ff329155beca23e323fa.tar.bz2
x86: fix disassembler build after 1a3b4f90bc5f
In commit 1a3b4f90bc5f ("x86: convert two pointers to (indexing) integers") I neglected the fact that compilers may warn about comparing ptrdiff_t (signed long) with size_t (unsigned long) values. Since just before we've checked that the value is positive, simply add a cast (despite my dislike for casts).
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/i386-dis.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 6f75abf..6161bf7 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -300,7 +300,7 @@ fetch_code (struct disassemble_info *info, const uint8_t *until)
if (needed <= 0)
return true;
- if (priv->fetched + needed <= ARRAY_SIZE (priv->the_buffer))
+ if (priv->fetched + (size_t) needed <= ARRAY_SIZE (priv->the_buffer))
status = (*info->read_memory_func) (start, fetch_end, needed, info);
if (status != 0)
{