]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Re: H8300 use of uninitialised value
authorAlan Modra <amodra@gmail.com>
Thu, 26 Mar 2020 05:56:16 +0000 (16:26 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 26 Mar 2020 09:32:42 +0000 (20:02 +1030)
commit832a580781060f54731fcf654d76ac1332037a47
treec1bcb32db186241befa7a78ceec2d2b2cc31e457
parentff7685105468702de87b75599b1ea88cc309541c
Re: H8300 use of uninitialised value

This patch also had some problems.  Calculation of maxlen was wrong,
and the insn arg loop needed rearranging to work with a correct length.

* disassemble.h (opcodes_assert): Declare.
(OPCODES_ASSERT): Define.
* disassemble.c: Don't include assert.h.  Include opintl.h.
(opcodes_assert): New function.
* h8300-dis.c (bfd_h8_disassemble_init): Use OPCODES_ASSERT.
(bfd_h8_disassemble): Reduce size of data array.  Correctly
calculate maxlen.  Omit insn decoding when insn length exceeds
maxlen.  Exit from nibble loop when looking for E, before
accessing next data byte.  Move processing of E outside loop.
Replace tests of maxlen in loop with assertions.
opcodes/ChangeLog
opcodes/disassemble.c
opcodes/disassemble.h
opcodes/h8300-dis.c