summaryrefslogtreecommitdiff
path: root/cris-dis.c
diff options
context:
space:
mode:
authoredgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-06 08:45:10 +0000
committeredgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-06 08:45:10 +0000
commitbfaf9a43a5cd25f683e8a42a8288f44232b72053 (patch)
treee7f46e01cc0452753a33a4f5a3b21bdf0a056102 /cris-dis.c
parent5c751e99c3ed3bbbf4610f64141fe4c00e843b71 (diff)
Teach the CRIS disassembler to stay within the provided buffer.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4353 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'cris-dis.c')
-rw-r--r--cris-dis.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/cris-dis.c b/cris-dis.c
index 3b09f2767..0781b0886 100644
--- a/cris-dis.c
+++ b/cris-dis.c
@@ -2625,12 +2625,10 @@ print_insn_cris_generic (bfd_vma memaddr,
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. */