qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4353] Teach the CRIS disassembler to stay within the provided buffer.
Date: Tue, 06 May 2008 08:45:11 +0000	[thread overview]
Message-ID: <E1JtInP-0006JR-JG@cvs.savannah.gnu.org> (raw)

Revision: 4353
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4353
Author:   edgar_igl
Date:     2008-05-06 08:45:10 +0000 (Tue, 06 May 2008)

Log Message:
-----------
Teach the CRIS disassembler to stay within the provided buffer.

Modified Paths:
--------------
    trunk/cris-dis.c

Modified: trunk/cris-dis.c
===================================================================
--- trunk/cris-dis.c	2008-05-06 08:44:21 UTC (rev 4352)
+++ trunk/cris-dis.c	2008-05-06 08:45:10 UTC (rev 4353)
@@ -2625,12 +2625,10 @@
      If we can't get any data, or we do not get enough data, we print
      the error message.  */
 
-  for (nbytes = MAX_BYTES_PER_CRIS_INSN; nbytes > 0; nbytes -= 2)
-    {
-      status = (*info->read_memory_func) (memaddr, buffer, nbytes, info);
-      if (status == 0)
-	break;
-    }
+  nbytes = info->buffer_length;
+  if (nbytes > MAX_BYTES_PER_CRIS_INSN)
+	  nbytes = MAX_BYTES_PER_CRIS_INSN;
+  status = (*info->read_memory_func) (memaddr, buffer, nbytes, info);  
 
   /* If we did not get all we asked for, then clear the rest.
      Hopefully this makes a reproducible result in case of errors.  */

                 reply	other threads:[~2008-05-06  8: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=E1JtInP-0006JR-JG@cvs.savannah.gnu.org \
    --to=edgar.iglesias@gmail.com \
    --cc=qemu-devel@nongnu.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 NNTP newsgroup(s).