From: Jan Beulich <jbeulich@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] x86: fix disassembler build after 1a3b4f90bc5f
Date: Fri, 26 May 2023 10:45:02 +0000 (GMT) [thread overview]
Message-ID: <20230526104502.D2D0C3858D39@sourceware.org> (raw)
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=93497bf9ab13a3d2aa06ff329155beca23e323fa
commit 93497bf9ab13a3d2aa06ff329155beca23e323fa
Author: Jan Beulich <jbeulich@suse.com>
Date: Fri May 26 12:44:52 2023 +0200
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).
Diff:
---
opcodes/i386-dis.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 6f75abf57f3..6161bf72459 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)
{
reply other threads:[~2023-05-26 10:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230526104502.D2D0C3858D39@sourceware.org \
--to=jbeulich@sourceware.org \
--cc=bfd-cvs@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).