This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[OB] fix array size in sh-dis.c



This array needs to be four bytes, in case we have to disassemble a four byte insn (eg. ppi). Otherwise, it clobbers one of the nearby local variables.

2004-01-13  Michael Snyder  <msnyder@redhat.com>

        * sh-dis.c (print_insn_sh): Allocate 4	bytes for insn.

Index: sh-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/sh-dis.c,v
retrieving revision 1.17
diff -p -r1.17 sh-dis.c
*** sh-dis.c	5 Dec 2003 02:02:32 -0000	1.17
--- sh-dis.c	13 Jan 2004 19:56:21 -0000
*************** print_insn_sh (memaddr, info)
*** 397,403 ****
  {
    fprintf_ftype fprintf_fn = info->fprintf_func;
    void *stream = info->stream;
!   unsigned char insn[2];
    unsigned char nibs[4];
    int status;
    bfd_vma relmask = ~(bfd_vma) 0;
--- 397,403 ----
  {
    fprintf_ftype fprintf_fn = info->fprintf_func;
    void *stream = info->stream;
!   unsigned char insn[4];
    unsigned char nibs[4];
    int status;
    bfd_vma relmask = ~(bfd_vma) 0;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]